ok guys, so i have a program due tomorrow that is supposed to print, (just pretend that the lines on the right side are straight)
+---------+
| * |
| /*\ |
| //*\\ |
| ///*\\\ |
| \\\*/// |
| \\*// |
| \*/ |
| * |
+---------+
| \\\*/// |
| \\*// |
| \*/ |
| * |
| * |
| /*\ |
| //*\\ |
| ///*\\\ |
+---------+
so far i have this, which will print the top half of the diamond, my question is, how do i essentially flip my code upside down to print the bottom?
public static void main(String[] args) {
line();
triangleTop();
}
public static void line() {
System.out.print("+");
for (int i = 1; i <= size * 2 + 1; i++) {
System.out.print("-");
}
System.out.print("+");
System.out.println();
}
public static void triangleTop() { // prints the top half of the triangle as
// well as the lines along either side
//* of it/*
for (int i = 1; i <= size; i++) {
System.out.print("|");
for (int j = 1; j <= size + 1 - i; j++) {
System.out.print(" ");
}
for (int d = 2; d <= i; d++) {
System.out.print("/");
}
System.out.print("*");
for (int e = 1; e <= i - 1; e++) {
System.out.print("\\");
}
for (int f = 1; f <= size + 1 - i; f++) {
System.out.print(" ");
}
System.out.print("|");
System.out.print("\n");
}
}
}
thanks!