100 Random Circles

100circles-01.jpg

int numCircles = 100; //number of circles

int circlesDrawn = 0; //circles have been drawn

void setup() {
 size(800, 800); 
 background(100); 
 
}

void draw() { //add 1 to the number of circles drawn
 
 if(circlesDrawn < numCircles) { //chose random position f
 
 ellipse(random(width), random(height),50,50);
 circlesDrawn = circlesDrawn + 1;
 }
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s