/home/jfernan6/NetBeansProjects/CSX/src/npw/Stella.java
 1 /*
 2  * To change this license header, choose License Headers in Project Properties.
 3  * To change this template file, choose Tools | Templates
 4  * and open the template in the editor.
 5  */
 6 package npw;
 7 
 8 import java.awt.Color;
 9 import java.util.Random;
10 import java.util.Scanner;
11 import painter.SPainter;
12 import shapes.SSquare;
13 
14 /**
15  *
16  * @author jfernan6
17  */
18 public class Stella {
19 
20     /**
21      * @param args the command line arguments
22      */
23     public static void main(String[] args) {
24         Scanner scanner =new Scanner(System.in);
25         SPainter painter = new SPainter(500,500);
26         SSquare square = new SSquare(500);
27         Random rand = new Random();
28         
29         Color randomColor1 = new Color(rand.nextInt(256),rand.nextInt(256),rand.nextInt(256));
30         Color randomColor2 = new Color(rand.nextInt(256),rand.nextInt(256),rand.nextInt(256));
31         
32         System.out.println("How many squares ?");
33         int input = scanner.nextInt();
34         int numberOfSquares =0;
35          int i = 0;
36         while(input >= numberOfSquares ){
37         if(i%2 ==0){
38             painter.setColor(randomColor1);
39             painter.paint(square);
40             square.shrink(input);
41             numberOfSquares++;
42             i++;
43         }
44         else{
45             painter.setColor(randomColor2);
46         painter.paint(square);
47        square.shrink(input);
48        numberOfSquares++;
49        i++;
50         }
51     
52        }
53       
54     }
55     
56  }
57 
58