Code
size(400,200);
background(255);
smooth();
for (int i=6; i>0; i--){
stroke(0,0,255/i);
line(20*i,50, 20*i,30);
}
for (int i=6; i>0; i--){
noStroke();
fill(255/i,0,0);
ellipse(20*i,50, 30,30);
}
for (int i=6; i>0; i--){
noStroke();
fill(255/i,0,0);
ellipse(30*i,100, 30,30);
}
for (int i=6; i>0; i--){
noStroke();
fill(255/i,0,0);
ellipse(40*i,150, 30,30);
}
0109 - For Loops VII: Open-Ended
Statement:Use a for structure to repeat an element of your own design. Your repeated element should use at least two different drawing primitives (e.g. line, ellipse, arc, etc.). You should also vary some visual property of the element in addition to its position (such as color, stroke weight, etc.).
hide statement