Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.47 KB | None | 0 0
  1.  
  2. /**
  3.  *
  4.  * @author almer
  5.  */
  6.  
  7. public class AsteriskMadness
  8. {
  9.     public static void main(String[] args)
  10.     {        
  11.         int spaces = 7;
  12.         int asterisks = 7;
  13.        
  14.         for(int i = 1; i < 5; i++) {
  15.             int valueOfI = i;
  16.             int valueOfI2 = i;
  17.             while( valueOfI > 0 ) {
  18.                 System.out.print("* ");
  19.                 valueOfI--;
  20.             }
  21.             for(int j = spaces; j > 0; j--) {
  22.                 System.out.print("  ");
  23.             }
  24.             spaces -= 2;
  25.             //--------
  26.             while( valueOfI2 > 0 ) {
  27.                 System.out.print("* ");
  28.                 valueOfI2--;
  29.             }
  30.             System.out.println();
  31.         }
  32.         //---------------------
  33.        
  34.         for(int i = 9; i > 0; i--) {
  35.             System.out.print("* ");
  36.         }
  37.         //---------------------
  38.         System.out.println();
  39.        
  40.         for(int i = 1; i < 5; i++) {
  41.             int valueOfI = i;
  42.             int valueOfI2 = i;
  43.             while( valueOfI > 0 ) {
  44.                 System.out.print("  ");
  45.                 valueOfI--;
  46.             }
  47.             for(int j = asterisks; j > 0; j--) {
  48.                 System.out.print("* ");
  49.             }
  50.             asterisks -= 2;
  51.             //--------
  52.             while( valueOfI2 > 0 ) {
  53.                 System.out.print("  ");
  54.                 valueOfI2--;
  55.             }
  56.             System.out.println();
  57.         }
  58.      }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement