/* This program was written by Michael Friedrich on September 19th, 2009. The purpose of this program is to create a randomized art piece that uses "for" or "while" statements in it's construction. In my opinion, it looks best in a smaller window size. The larger it is, the more chaotic it appears. */ //These functions set up the size of the canvas, antialiasing, //no fill, RGB color mode, sets the ellipse and rectangle modes //to center, sets the background to white, and sets the corners //of the rectangles drawn to be beveled. size(150, 150); background(255); smooth(); noFill(); colorMode(RGB, 255, 255, 255); rectMode(CENTER); ellipseMode(CENTER); strokeJoin(BEVEL); //These 4 integer variables are established here but aren't given //any value so that they can be locally used in the code blocks //below. int l; int m; int n; int o; //This variable is used locally in the code blocks below to //determine the stroke weight. int s; //These variables are in used in the first code block to determine //the (x,y) co-ordinates of the bezier handles, and in the second //code block to determine the (x,y) co-ordinates of the shapes, as //well as the size of the shapes. int b1; int b2; int c1; int c2; //This "for" loop creates an x int variable equal to 0, then checks to see //if x is less than the canvas' width. If it is, it adds a random amount //between 1 and 20 to x and executes the code block below. for(int x = 0; x < width; x+=(int)random(20)){ b1 = (int)random(width); b2 = (int)random(height); c1 = (int)random(width); c2 = (int)random(height); l = (int)random(80,255); //Sets l to a random number between 80 and 255. s = (int)random(6); //The s variable declared at the top is used strokeWeight(s); //to set the stroke weight to a random //number between 1 and 6. if(x