import java.awt.*; import hsa.Console; public class Portrait3 { static Console c; public static void main (String[] args) { Color LBrown = new Color (191, 104, 17); //Code for light brown colour Color DBrown = new Color (140, 86, 6); //Code for dark brown colour Color LBlue = new Color (147, 232, 235); //Code for light blue colour Color Grey = new Color (153, 153, 153); //Code for grey colour int faceColor, eyeShape, eyeColor, noseShape, noseColor; String Eyeman; c = new Console (); //Face color // c.println ("Would you like the shape of your face to be\n 1- round \n 2- square"); // faceShape = c.readInt (); c.println ("Would you like the colour of your face to be\n 1- light brown \n 2- dark brown"); faceColor = c.readInt (); c.clear (); //Eyes shape & color c.println ("Would you like the shape of your eyes to be\n 1- oval \n 2- circle"); eyeShape = c.readInt (); c.println ("Would you like the colour of your eyes to be\n 1- blue \n 2- green"); eyeColor = c.readInt (); c.clear (); //Nose shape & color c.println ("Would you like the shape of your nose to be\n 1- circle \n 2- triangle"); noseShape = c.readInt (); c.println ("Would you like the colour of your nose to be\n 1- yellow \n 2- grey"); noseColor = c.readInt (); c.clear (); //If statements //Face if (faceColor == 1) { c.setColor (LBrown); c.fillOval (100, 100, 400, 400); } else { c.setColor (DBrown); c.fillOval (100, 100, 400, 400); } //////////////////////////////////////////////////// //Eyes if (eyeShape == 1) { if (eyeColor == 1) { //Left Eye c.setColor (LBlue); c.fillOval (175, 185, 100, 60); //draw the left eye c.setColor (Color.black); //change colour to black c.fillOval (205, 200, 40, 40); //Draw the left eye balls c.setColor (Color.white); //change colour to white c.fillOval (217, 214, 15, 15); //smallest circle in the eye //Right Eye c.setColor (LBlue); c.fillOval (320, 185, 100, 60); //draw the right eye c.setColor (Color.black); //change colour to black c.fillOval (350, 200, 40, 40); //draw the right eye balls c.setColor (Color.white); //change colour to white c.fillOval (362, 214, 15, 15); //draw the circle in the eye } else { //Left Eye c.setColor (Color.green); c.fillOval (175, 185, 100, 60); //draw the left eye c.setColor (Color.black); //change colour to black c.fillOval (205, 200, 40, 40); //Draw the left eye balls c.setColor (Color.white); //change colour to white c.fillOval (217, 214, 15, 15); //smallest circle in the eye //Right Eye c.setColor (Color.green); c.fillOval (320, 185, 100, 60); //draw the right eye c.setColor (Color.black); //change colour to black c.fillOval (350, 200, 40, 40); //draw the right eye balls c.setColor (Color.white); //change colour to white c.fillOval (362, 214, 15, 15); //draw the circle in the eye } } else if (eyeShape == 2) { if (eyeColor == 1) { //Left Eye c.setColor (LBlue); //change colour to light blue c.fillOval (185, 185, 80, 80); //draw the left eye c.setColor (Color.black); //change colour to black c.fillOval (205, 205, 40, 40); //Draw the left eye balls c.setColor (Color.white); //change colour to white c.fillOval (217, 219, 15, 15); //smallest circle in the eye //Right Eye c.setColor (LBlue); //change colour to light blue c.fillOval (330, 185, 80, 80); //draw the right eye c.setColor (Color.black); //change colour to black c.fillOval (350, 205, 40, 40); //draw the right eye balls c.setColor (Color.white); //change colour to white c.fillOval (362, 219, 15, 15); //draw the circle in the eye } else { //Left Eye c.setColor (Color.green); //change colour to green c.fillOval (185, 185, 80, 80); //draw the left eye c.setColor (Color.black); //change colour to black c.fillOval (205, 205, 40, 40); //Draw the left eye balls c.setColor (Color.white); //change colour to white c.fillOval (217, 219, 15, 15); //smallest circle in the eye //Right Eye c.setColor (Color.green); //change colour to green c.fillOval (330, 185, 80, 80); //draw the right eye c.setColor (Color.black); //change colour to black c.fillOval (350, 205, 40, 40); //draw the right eye balls c.setColor (Color.white); //change colour to white c.fillOval (362, 219, 15, 15); //draw the circle in the eye } } //////////////////////////////////////////////////// //Nose if (noseShape == 1) { if (noseColor == 1) { c.setColor (Color.yellow); //change colour to grey c.fillOval (270, 280, 50, 50); //draw the nose } else { c.setColor (Grey); c.fillOval (270, 280, 50, 50); //draw the nose } } else if (noseShape == 2) { if (noseColor == 1) { c.setColor (Color.yellow); for (int x = 265 ; x <= 325 ; x += 1) for (int y = 320 ; y <= 320 ; y += 1) c.drawLine (295, 270, x, y); } else { c.setColor (Grey); for (int x = 265 ; x <= 325 ; x += 1) for (int y = 320 ; y <= 320 ; y += 1) c.drawLine (295, 270, x, y); } } //Mouth c.setColor (Color.white); //change colour to white c.fillOval (190, 350, 220, 80); //draw first part of mouth c.setColor (LBrown); //change colour to brown c.fillOval (190, 350, 230, 50); //draw second part of mouth //Teeth c.setColor (Color.black); c.drawLine (200, 385, 195, 400); c.drawLine (220, 391, 215, 415); c.drawLine (240, 395, 235, 422); c.drawLine (260, 397, 255, 426); c.drawLine (280, 398, 275, 429); //c.drawLine (300, 400, 295, 430); c.drawLine (300, 400, 300, 430); c.drawLine (320, 398, 325, 428); c.drawLine (340, 397, 345, 426); c.drawLine (360, 395, 365, 422); c.drawLine (380, 393, 385, 415); c.drawLine (400, 388, 405, 400); //Teeth Lines c.drawLine (190, 387, 196, 392); c.drawLine (196, 392, 215, 403); c.drawLine (215, 403, 235, 409); c.drawLine (235, 409, 255, 412); c.drawLine (255, 412, 275, 414); c.drawLine (275, 414, 298, 413); c.drawLine (298, 414, 321, 413); c.drawLine (321, 413, 341, 411); c.drawLine (341, 411, 361, 408); c.drawLine (361, 408, 381, 403); c.drawLine (381, 403, 402, 395); c.drawLine (402, 395, 409, 387); } }