exercise#1
function setup( ){
createCanvas(600,120);
}
function draw( ){
background(220);
for(x=10;width > x;x=x+20){
ellipse(x,10,15,15)
}
for(y=10;height > y;y=y+20){
ellipse(10,y,15,15)
}
for(y=10;height > y;y=y+20){
ellipse(30,y,15,15)
}
for(y=10;height > y;y=y+20){
ellipse(50,y,15,15)
}
for(y=10;height > y;y=y+20){
ellipse(70,y,15,15)
}
}
exercise#2
function setup() {
createCanvas(600, 120);
}
function draw() {
background(220);
for (x = 0; x <= width; x = x + 40) {
for (var y = 0; y <= height; y = y + 40) {
fill(255, 0, 0);
ellipse(x, y, 40, 40);
fill(0, 255, 255);
ellipse(x, y, 30, 30);
fill(0, 0, 255);
ellipse(x, y, 20, 20);
fill(255, 0, 255);
ellipse(x, y, 10, 10);
}
}
}