/ p5 / re-code 21

Sol Lewitt  Wall Drawing 452

function setup(){
 createCanvas(780, 390); 
 noStroke(); 
 noLoop();
 smooth()
}

function draw(){
 background(255);
 var x = int(random(width));
 var y = int(random(height));
 var black = true;
var numberOfCircles = 30;
var radius = 2 * width;
var decr = radius / numberOfCircles; 
 for (var i = 0; i < numberOfCircles;i++) {
  if (black == true) {
    fill(0);
  }
  else {
    fill(255);
  }
  ellipse(x, y, radius, radius);
  radius = radius - decr;
  if (i%2 == 0) {
    black = false;
  }
  else {
    black = true;
  }
} // end i loop
}

function mousePressed(){
//save("lewitt-462.png");
redraw();
}