Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.54 KB | None | 0 0
  1. /*
  2.  
  3.  - Name: Ishaan Dave
  4.  - EmoryID: idave (2122832)
  5.  - Collaboration Statement: "I worked on this assignment alone, using only this semester's course materials."
  6.  
  7. */
  8.  
  9.  
  10. public class HW2 {
  11.  
  12.  
  13.  /*This method, hair1, creates hair/a head that is supposed to be a straw hat type thing*/
  14.  
  15.   public static String hair1() {
  16.    return "  ___________  \n //////|\\\\\\\\\\\\\n///////|" + "\\" + "\\" + "\\" +"\\"+"\\"+"\\"+"\\";
  17.    }
  18.  
  19.  
  20.  
  21.  /*This method, hair2, creates curly, afro-ish hair out of @ symbols*/
  22.  
  23.   public static String hair2() {
  24.    return "\n  @@@@@@@@@@@  \n @@@@@@@@@@@@@\n@@@@@@@@@@@@@@@";
  25.   }
  26.  
  27.  
  28.  
  29.  /*This method, hair3, creates hair that looks kind of like a fade-combover type look*/
  30.  
  31.  public static String hair3() {
  32.    return "\n///////////////";
  33.   }
  34.  
  35.  
  36.  
  37.  public static String side() {
  38.    return "|             |";
  39.  }
  40.  
  41.  /*This method, eyes1, creates closed eyes -- either to portray seriousness or a meditative state*/
  42.  
  43.   public static String eyes1() {
  44.    return "| ----- ----- | ";//Need side before and after
  45.   }
  46.  
  47.  
  48.  
  49. /*This method, eyes2, creates cheerful looking eyes*/
  50.  
  51.   public static String eyes2() {
  52.    return "|   /\\   /\\   |"; //Side before and after
  53.   }
  54.  
  55.  
  56.  
  57. /*This method, eyes3, creates eyes that are looking to the our right, the character's left*/
  58.  
  59.   public static String eyes3() {
  60.     return "|   (0   (0   |"; //before and after
  61.   }  
  62.  
  63.  
  64.  
  65. /*This method, nose, creates a simplistic nose*/
  66.  
  67.   public static String nose() {
  68.     return "|     /       |\n|    /___     |";
  69.   }
  70.  
  71.  
  72.  
  73. /*This method, mouth1, creates a mouth that is very stern looking, not to show any emotion*/  
  74.  
  75.   public static String mouth1() {
  76.     return "|   ~~~~~~~   |";//before and after
  77.   }
  78.  
  79.  
  80.  
  81. /*This method, mouth2, creates a very soft smile*/  
  82.  
  83.    public static String mouth2() {
  84.     return "|  \\_______/  |";//before and after
  85.   }
  86.    
  87.    
  88.    
  89. /*This method, mouth3, creates a mouth to show a smirk on the character's face*/  
  90.    
  91.    public static String mouth3() {
  92.     return "|      ____/  |";//before and after
  93.   }
  94.    
  95.    
  96.    
  97. /*This method, chin1, creates a chin/beard for the character*/  
  98.    
  99.   public static String chin1() {
  100.    return " \\.........../\n  88888888888   \n    8888888   \n      888     ";
  101.   }
  102.  
  103.  
  104.  
  105. /*This method, chin2, creates a clean shaven man with a very large, straight chin*/  
  106.  
  107.   public static String chin2() {
  108.     return "\\_____________/";
  109.   }
  110.  
  111.  
  112.  
  113. /*This method, chin3, creates a chin/beard with a very clean cut that's very under control -- unlike chin1*/
  114.  
  115.   public static String chin3() {
  116.     return "\\_____________/\n ||||||||||||| ";
  117.   }
  118.  
  119.  
  120.  
  121.   public static void totemHead() {
  122.     //Math.random() generates a random double [0.0-1.0)
  123.     double r = 3 * Math.random();
  124.     int rand = (int) r;
  125.     /* System.out.println(r + "--->" + rand);*/
  126.     if (rand == 0) {
  127.       System.out.println( hair1() );
  128.       System.out.println( side() );
  129.       System.out.println( eyes1() );
  130.       System.out.println( side() );
  131.       System.out.println( nose() );
  132.       System.out.println( side() );
  133.       System.out.println( mouth1() );
  134.       System.out.println( side() );
  135.       System.out.println( chin1() );  
  136. }
  137.     else if (rand == 1) {
  138.       System.out.println( hair2() );
  139.       System.out.println( side() );
  140.       System.out.println( eyes2() );
  141.       System.out.println( side() );
  142.       System.out.println( nose() );
  143.       System.out.println( side() );
  144.       System.out.println( mouth2() );
  145.       System.out.println( side() );
  146.       System.out.println( chin2() ); ;
  147. }
  148.     else if (rand == 2) {
  149.     /*If rand = 2, then no nose will be printed*/
  150.       System.out.println( hair3() );
  151.       System.out.println( side() );
  152.       System.out.println( eyes3() );
  153.       System.out.println( side() );
  154.       System.out.println( side() );
  155.       System.out.println( mouth3() );
  156.       System.out.println( side() );
  157.       System.out.println( side() );
  158.       System.out.println( chin3() ); ;
  159.   }  
  160.  }
  161.  
  162.  
  163.  public static void totemPole() {
  164.      HW2.totemHead();
  165.      HW2.totemHead();
  166.      HW2.totemHead();
  167.  }
  168.  
  169.  public static void main(String[] args) {
  170.    HW2.totemPole();
  171.  
  172.   /*Testing individual features
  173.   String h1 = HW2.hair1();
  174.   String h2 = HW2.hair2();
  175.   String h3 = HW2.hair3();
  176.   String e1 = HW2.eyes1();
  177.   String e2 = HW2.eyes2();
  178.   String e3 = HW2.eyes3();
  179.   String n = HW2.nose();
  180.   String m1 = HW2.mouth1();
  181.   String m2 = HW2.mouth2();
  182.   String m3 = HW2.mouth3();
  183.   String c1 = HW2.chin1();
  184.   String c2 = HW2.chin2();
  185.   String c3 = HW2.chin3();
  186.   String s = HW2.side();
  187.   totemHead();
  188.  
  189.  /* String m = HW2.mouth();
  190.   String c = HW2.chin();
  191.   String n = HW2.nose();
  192.  
  193.   System.out.println(h1);
  194.   System.out.println(s);
  195.   System.out.println(e1);
  196.    System.out.println(s);
  197.   System.out.println(n);
  198.    System.out.println(s);
  199.   System.out.println(m1);
  200.    System.out.println(s);
  201.   System.out.println(c1);
  202.   System.out.println(h2);
  203.    System.out.println(s);
  204.   System.out.println(e2);
  205.    System.out.println(s);
  206.   System.out.println(n);
  207.    System.out.println(s);
  208.   System.out.println(m2);
  209.    System.out.println(s);
  210.   System.out.println(c2);
  211.   System.out.println(h3);
  212.    System.out.println(s);
  213.   System.out.println(e3);
  214.    System.out.println(s);
  215.   System.out.println(n);
  216.    System.out.println(s);
  217.   System.out.println(m3);
  218.    System.out.println(s);
  219.   System.out.println(c3);
  220.    
  221.   /*System.out.println(n);
  222.   System.out.println(m);
  223.   System.out.println(c);*/
  224.  }
  225. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement