Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.15 KB | None | 0 0
  1.     /*      Nose & Mouth        */
  2.     public static void noseAndMouth() {
  3.         // the amount of decrease, which is increasing in each line.
  4.         int iaod=0;
  5.         // the variable to help the variable iaod.
  6.         int hiaod=1;
  7.         /* to repeat following 3 lines 2 times */
  8.         for(int times=1; times<=2; times++) {
  9.             for(int line=1; line<=3; line++) { // to print 3 lines
  10.                 /* the variable to find 1 in first line,
  11.                 0 in second line, and 0 in third line */
  12.                 int mod = (line%3)%2;
  13.                 for(int spaces=1; spaces<=16; spaces++) {
  14.                     System.out.print(" ");
  15.                 }
  16.                 for(int spaces=0; spaces<=times-mod; spaces++) {
  17.                     System.out.print(" ");
  18.                 }
  19.                 for(int sharps=1; sharps<=2-mod; sharps++) {
  20.                     System.out.print("#");
  21.                 }
  22.                 for(int spaces=1; spaces<=2*mod+8-times; spaces++) {
  23.                     System.out.print(" ");
  24.                 }
  25.                 for(int sharps=1; sharps<=18-iaod; sharps++) {
  26.                     System.out.print("#");
  27.                 }
  28.                 for(int spaces=1; spaces<=7+iaod-2*hiaod; spaces++) {
  29.                     System.out.print(" ");
  30.                 }
  31.                 for(int sharps=1; sharps<=hiaod-1; sharps++) {
  32.                     System.out.print("#");
  33.                 }
  34.                 System.out.print("  ");
  35.                 System.out.print("##");
  36.                 iaod+=hiaod;
  37.                 hiaod+=1;
  38.                 System.out.println();
  39.             }
  40.         }
  41.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement