DeterministicInvention.java
1    
2    
3    package npw;
4    
5    import painter.SPainter;
6    import shapes.SCircle;
7    import shapes.SSquare;
8    
9    import java.awt.*;
10   
11   public class DeterministicInvention {
12       public static void main(String [] args){
13           SCircle circle = new SCircle(50);
14           SSquare square = new SSquare(25);
15           SPainter bob = new SPainter("Invention1",600 ,600);
16           bob.setColor(Color.blue);
17           bob.paint(circle);
18   
19   
20   
21           int w = 1;
22           while (w <=4){
23               bob.mfd(100);
24           bob.paint(square);
25           w = w+1;
26   
27       }
28           bob.moveToCenter();
29           int y = 1;
30           while (y < 30){
31               if (y < 5){
32                   bob.setColor(Color.green);
33               }
34               else{
35                   bob.setColor(Color.YELLOW);
36               }
37                   bob.paint(circle);
38               bob.mlt(5);
39               bob.paint(circle);
40               y = y+1;
41   
42   
43           }
44   
45   
46   
47   
48   }}
49   
50