/* title: Funky Chunk 16 - standalone program 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=400; int centre=sizeWindow/2; int xpos = centre; int ypos = centre; int patternsPerPicture=round(random(2,50)); //this variable is changed frequently by the application int interval=width/25; int count; int fCount=0; boolean [] recs=new boolean[9]; // 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); //smooth(); frameRate(.4); } void draw(){ background(0); for(int count=0;count=50)exit(); patternsPerPicture=round(random(5,50));//change number of patterns for next picture // patternsPerPicture=1;//change number of patterns for next picture } //function changeColour: to change the stroke colour no parameters no return value*/ void changeColour(){ stroke(random(255),random(255),random(255)); } void keyPressed() { save("_0ch16.jpg"); } //function draws circles accepts parameter gap and uses it to increment loop untill void drawCircles(int gap){ for(int n=0;n5)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); } } } }