xxxxxxxxxx
17
const NUM_CIRCLES = 8;
let radius;
let spacing = 15;
function setup() {
createCanvas(400, 400);
// how do we make NUM_CIRCLES evenly spaced circles?
let circleSpace = width / NUM_CIRCLES;
radius = circleSpace - spacing - (spacing/NUM_CIRCLES);
}
function draw() {
background(220);
for (let i = 0; i < NUM_CIRCLES; i+=1) {
circle((radius/2) + spacing + i*(radius + spacing), 100, radius);
}
}