/* title: Funky Chunk 16 description: random pattern generator created: December 2, 2008 by: Rosie Wood */ // define Global variable values //These are constant variables and therefore they are not changed //by the program. Setting their value here in one place helps with maimtenance int sizeWindow=600; int centre=sizeWindow/2; int xpos = centre; int ypos = centre; int patternsPerPicture=round(random(2,50)); boolean [] recs=new boolean[9]; //this variable is changed frequently by the application int interval=30; int count; // set the sketch window size and background //turn off fill so that patterns underneath can be seen //set the rate that the screen refreshes at (found this value was best for this application?) void setup(){ size(sizeWindow, sizeWindow); background(0); stroke(204, 102, 0);//colour red noFill(); frameRate(.2); draw(); } void draw(){ //local variables count=0; int design=0; background(0); for(count=0;count5)down=2; else if (n>2){down=1;} if(sType==1){ rect(midxy[mod], midxy[down], d, d); } else{ ellipse(midxy[mod], midxy[down], d, d);} println("mod: "+mod); println("down: "+down); println("across: "+midxy[mod]); println("down: "+midxy[down]); } } }