Code

background(220);
size(425,100);
noStroke();
fill(0);
smooth();

for (int i=100; i<350; i+=25){
  if (i>=250){
    fill(255,0,0);
  }
  else{
  fill(0);
  }  
  ellipse(i, 50, 20,20);
}

0208 - Conditionals within a for{} loop II: Combining if{} and for{}

Statement:For this assignment, you are limited to a single for{} loop. Assignments using more than one for{} loop will not be credited.
Use an inequality test, embedded inside a for{} loop, to produce the figure shown here (and below), which is very similar to your previous image. (An "inequality test" is a comparison like greater-than, less-than, greater-than-or-equal, or less-than-or-equal.)


hide statement