1 package npw; 2 3 import painter.SPainter; 4 import shapes.SCircle; 5 import shapes.SSquare; 6 7 import java.awt.*; 8 9 public class Invention1 { 10 11 public static void main(String[] args) { 12 SPainter cryingRobot = new SPainter("Crying Robot", 700, 700); 13 SSquare eye = new SSquare(100); 14 SCircle tear = new SCircle(20); 15 eye.expand(500); 16 cryingRobot.setColor(Color.LIGHT_GRAY); 17 cryingRobot.paint(eye); 18 eye.shrink(500); 19 20 int i = 0; 21 22 while (i < 2) { 23 if (i == 0) { 24 cryingRobot.mlt(150); 25 } else { 26 cryingRobot.mrt(150); 27 } 28 cryingRobot.mfd(150); 29 cryingRobot.setColor(Color.YELLOW); 30 cryingRobot.paint(eye); 31 int j = 1; 32 while (j <= 3) { 33 cryingRobot.mbk(50*j); 34 cryingRobot.setColor(Color.BLUE); 35 cryingRobot.paint(tear); 36 j = j + 1; 37 } 38 cryingRobot.moveToCenter(); 39 i = i + 1; 40 } 41 42 tear.expand(10); 43 cryingRobot.setColor(Color.red); 44 cryingRobot.paint(tear); 45 cryingRobot.mbk(200); 46 eye.expand(50); 47 cryingRobot.setColor(Color.black); 48 cryingRobot.paint(eye); 49 50 51 } 52 53 }