Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @author almer
- */
- public class AsteriskMadness
- {
- public static void main(String[] args)
- {
- int spaces = 7;
- int asterisks = 7;
- for(int i = 1; i < 5; i++) {
- int valueOfI = i;
- int valueOfI2 = i;
- while( valueOfI > 0 ) {
- System.out.print("* ");
- valueOfI--;
- }
- for(int j = spaces; j > 0; j--) {
- System.out.print(" ");
- }
- spaces -= 2;
- //--------
- while( valueOfI2 > 0 ) {
- System.out.print("* ");
- valueOfI2--;
- }
- System.out.println();
- }
- //---------------------
- for(int i = 9; i > 0; i--) {
- System.out.print("* ");
- }
- //---------------------
- System.out.println();
- for(int i = 1; i < 5; i++) {
- int valueOfI = i;
- int valueOfI2 = i;
- while( valueOfI > 0 ) {
- System.out.print(" ");
- valueOfI--;
- }
- for(int j = asterisks; j > 0; j--) {
- System.out.print("* ");
- }
- asterisks -= 2;
- //--------
- while( valueOfI2 > 0 ) {
- System.out.print(" ");
- valueOfI2--;
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement