-
For loop graphics
Im doing a project and i got only a 1/5 of the way there. i want to use (*) to create 5 basic shapes using 4 loops and arrays. The first shape the diamond i have completed. what i need is a rectangle, a square, a bulls eye (like a shooting target 4 circles) and a hypnoses spiral. <deleted by moderator>. just note im new to the forums. the diamond code i have looks like this
Code:
class Diamond {
public static void main(String[] args) {
for (int i = 1; i < 10; i += 2) {
for (int j = 0; j < 9 - i / 2; j++)
System.out.print(" ");
for (int j = 0; j < i; j++)
System.out.print("*");
System.out.print("\n");
}
for (int i = 7; i > 0; i -= 2) {
for (int j = 0; j < 9 - i / 2; j++)
System.out.print(" ");
for (int j = 0; j < i; j++)
System.out.print("*");
System.out.print("\n");
}
}
}
/*
*
***
*****
*******
*********
*******
*****
***
*
*/