Infinite monkey theorem

/* Spot Painting Generator
* (c) Ed Parham 2015 */

void setup() {
size(1500,1500);
ellipseMode(CORNER);
noStroke();
frameRate(1);
}
void draw() {
background(255);
int num = (int) random(3,10);
int gap = (int) (35);
int margin = (int) (40);
float gutter = 5;
float cellsize = ( width – (2 * margin) – gutter * (num – 1) ) / num;
float cellsize_x = ( width – (num + 1) * gap ) / (float)num;
float cellsize_y = ( height – (num + 1) * gap ) / (float)num;
for (int i=0; i<num; i++) {
for (int j=0; j<num; j++) {
fill((random(0,255)),random(0,255),random(0,255));
ellipse(random(0,5)+gap * (i+1) + cellsize_x * i, random(0,5)+gap * (j+1) + cellsize_y * j, cellsize_x, cellsize_y);
}
}
}

Spot Paintings (c) Damien Hirst

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: