/home/akc/NetBeansProjects/CS1/src/npw/Invention1.java
 1 /*
 2  * Painting an image subject to the following constraints:
 3  * 1. It uses at least one while statement in a nontrivial way
 4  * 2. It uses at least one if statement in a nontrivial way
 5  * 3. It features both circles and squares, all created from just one circle
 6  *      and just one square. No rectangles.
 7  * 4. It creates the exact same image every time it is run.
 8  */
 9 package npw;
10 
11 import java.awt.Color;
12 import painter.SPainter;
13 import shapes.SCircle;
14 import shapes.SSquare;
15 
16 /**
17  *
18  * @author akc
19  */
20 public class Invention1 {
21 
22     /**
23      * @param args the command line arguments
24      */
25     public static void main(String[] args) {
26         SPainter painter = new SPainter("Deterministic", 600, 600);
27         int i = 380;
28         while (i < 581) {
29             SSquare square = new SSquare (i);
30             painter.setColor(Color.red);
31             painter.draw(square);
32             i = i + 3;
33         }
34         i = 165;
35         if (i < 166) {
36             while (i > 2) {
37                 SCircle circle = new SCircle (i);
38                 painter.setColor(Color.orange);
39                 painter.draw(circle);
40                 i = i - 1;
41             }
42         }
43         
44     }  
45 }
46 
47