Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- - Name: Ishaan Dave
- - EmoryID: idave (2122832)
- - Collaboration Statement: "I worked on this assignment alone, using only this semester's course materials."
- */
- public class HW2 {
- /*This method, hair1, creates hair/a head that is supposed to be a straw hat type thing*/
- public static String hair1() {
- return " ___________ \n //////|\\\\\\\\\\\\\n///////|" + "\\" + "\\" + "\\" +"\\"+"\\"+"\\"+"\\";
- }
- /*This method, hair2, creates curly, afro-ish hair out of @ symbols*/
- public static String hair2() {
- return "\n @@@@@@@@@@@ \n @@@@@@@@@@@@@\n@@@@@@@@@@@@@@@";
- }
- /*This method, hair3, creates hair that looks kind of like a fade-combover type look*/
- public static String hair3() {
- return "\n///////////////";
- }
- public static String side() {
- return "| |";
- }
- /*This method, eyes1, creates closed eyes -- either to portray seriousness or a meditative state*/
- public static String eyes1() {
- return "| ----- ----- | ";//Need side before and after
- }
- /*This method, eyes2, creates cheerful looking eyes*/
- public static String eyes2() {
- return "| /\\ /\\ |"; //Side before and after
- }
- /*This method, eyes3, creates eyes that are looking to the our right, the character's left*/
- public static String eyes3() {
- return "| (0 (0 |"; //before and after
- }
- /*This method, nose, creates a simplistic nose*/
- public static String nose() {
- return "| / |\n| /___ |";
- }
- /*This method, mouth1, creates a mouth that is very stern looking, not to show any emotion*/
- public static String mouth1() {
- return "| ~~~~~~~ |";//before and after
- }
- /*This method, mouth2, creates a very soft smile*/
- public static String mouth2() {
- return "| \\_______/ |";//before and after
- }
- /*This method, mouth3, creates a mouth to show a smirk on the character's face*/
- public static String mouth3() {
- return "| ____/ |";//before and after
- }
- /*This method, chin1, creates a chin/beard for the character*/
- public static String chin1() {
- return " \\.........../\n 88888888888 \n 8888888 \n 888 ";
- }
- /*This method, chin2, creates a clean shaven man with a very large, straight chin*/
- public static String chin2() {
- return "\\_____________/";
- }
- /*This method, chin3, creates a chin/beard with a very clean cut that's very under control -- unlike chin1*/
- public static String chin3() {
- return "\\_____________/\n ||||||||||||| ";
- }
- public static void totemHead() {
- //Math.random() generates a random double [0.0-1.0)
- double r = 3 * Math.random();
- int rand = (int) r;
- /* System.out.println(r + "--->" + rand);*/
- if (rand == 0) {
- System.out.println( hair1() );
- System.out.println( side() );
- System.out.println( eyes1() );
- System.out.println( side() );
- System.out.println( nose() );
- System.out.println( side() );
- System.out.println( mouth1() );
- System.out.println( side() );
- System.out.println( chin1() );
- }
- else if (rand == 1) {
- System.out.println( hair2() );
- System.out.println( side() );
- System.out.println( eyes2() );
- System.out.println( side() );
- System.out.println( nose() );
- System.out.println( side() );
- System.out.println( mouth2() );
- System.out.println( side() );
- System.out.println( chin2() ); ;
- }
- else if (rand == 2) {
- /*If rand = 2, then no nose will be printed*/
- System.out.println( hair3() );
- System.out.println( side() );
- System.out.println( eyes3() );
- System.out.println( side() );
- System.out.println( side() );
- System.out.println( mouth3() );
- System.out.println( side() );
- System.out.println( side() );
- System.out.println( chin3() ); ;
- }
- }
- public static void totemPole() {
- HW2.totemHead();
- HW2.totemHead();
- HW2.totemHead();
- }
- public static void main(String[] args) {
- HW2.totemPole();
- /*Testing individual features
- String h1 = HW2.hair1();
- String h2 = HW2.hair2();
- String h3 = HW2.hair3();
- String e1 = HW2.eyes1();
- String e2 = HW2.eyes2();
- String e3 = HW2.eyes3();
- String n = HW2.nose();
- String m1 = HW2.mouth1();
- String m2 = HW2.mouth2();
- String m3 = HW2.mouth3();
- String c1 = HW2.chin1();
- String c2 = HW2.chin2();
- String c3 = HW2.chin3();
- String s = HW2.side();
- totemHead();
- /* String m = HW2.mouth();
- String c = HW2.chin();
- String n = HW2.nose();
- System.out.println(h1);
- System.out.println(s);
- System.out.println(e1);
- System.out.println(s);
- System.out.println(n);
- System.out.println(s);
- System.out.println(m1);
- System.out.println(s);
- System.out.println(c1);
- System.out.println(h2);
- System.out.println(s);
- System.out.println(e2);
- System.out.println(s);
- System.out.println(n);
- System.out.println(s);
- System.out.println(m2);
- System.out.println(s);
- System.out.println(c2);
- System.out.println(h3);
- System.out.println(s);
- System.out.println(e3);
- System.out.println(s);
- System.out.println(n);
- System.out.println(s);
- System.out.println(m3);
- System.out.println(s);
- System.out.println(c3);
- /*System.out.println(n);
- System.out.println(m);
- System.out.println(c);*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement