charMatrix

From LiBaX, 7 Years ago, written in Java, viewed 614 times.
URL https://code.nat.moe/view/f993e8c0 Embed
Download Paste or View Raw
  1. public class charMatrix {
  2.  
  3.         private static String getRow(String pattern, int count) {
  4.                 if (count == 1) return pattern;
  5.                 pattern = pattern + getRow(pattern, count - 1);
  6.                 return pattern;
  7.         }
  8.  
  9.         public static int c = 0;
  10.  
  11.         public static void main(String[] args){
  12.                 c++;
  13.                 int i = 0;
  14.                 for (i = 0; i < 3; ++i) System.out.println(getRow("x ", i + 3));
  15.                 for (; i >= 0; --i) System.out.println(getRow("x ", i + 3));
  16.                 charMatrix pro = new charMatrix();
  17.                 if (c < 5) pro.main(args);
  18.         }
  19. }

Reply to "charMatrix"

Here you can reply to the paste above

captcha