CS1 Standard Demo Page

The following text was written to the standard output stream when the Invention2.java program was executed from Netbeans.

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package npw;

import java.awt.Color;
import painter.SPainter;
import shapes.SRectangle;

/**
 *
 * @author ecuevas
 */
public class Invention2 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        SRectangle rectangle = new SRectangle(150,200);
        SPainter painter = new SPainter("rectangles upon recrtangles", 600,600);
        int i = 1;
        int x = (int)(Math.random()*256);
        painter.move();
        painter.tl(45);
        painter.paint(rectangle);
        i = i + 1;
        
        while (i <= 10) {
            if (x<= 150) {
                painter.setColor(Color.MAGENTA);
                painter.move();
                painter.paint(rectangle);
                i = i + 1;
            }
        }
    }
    
}