/** * Drawing squares. * *

Elie Zananiri
* CART 253, Winter 2008

*/ int minSize = 50; int maxSize = 100; void setup() { size(400, 400); smooth(); rectMode(CENTER); strokeWeight(2); } void draw() { drawSquares(random(width), random(height), random(minSize, maxSize)); } void drawSquares(float xPos, float yPos, float sqSize) { // draw the outer square first fill(254, 255, 0); stroke(255, 166, 0); drawSquare(xPos, yPos, sqSize); // draw the inner square next fill(252, 233, 8); stroke(216, 61, 4); drawSquare(xPos, yPos, sqSize/2); } void drawSquare(float xPos, float yPos, float sqSize) { rect(xPos, yPos, sqSize, sqSize); }