I'm having problems finishing my java homework - please help
I need to write a method that draws an upside down pattern based on a given string (what the pattern is made of), and an int n (how many lines it has). So far I've managed to get it to work, but only the "right side up." What am I doing wrong?
This is the code I have now:
Example: for printPattern("*", 4) I currently get:public static void printPattern(String str, int n) { if (n < 1) { return; } System.out.println(str); printPattern(str + str, n - 1); }
*
**
****
********
and I'm supposed to get:
********
****
**
*
Please help. Thanks in advance!