Dra­w­i­n­g with Loops

by Julia Spyrou
  • Show Sketch
/** @peep sketchcode */
 stroke (234); 
  background(255);
  int y = 20; 
 
  for (int x = 20; x < width; x += 20) { 
  rect(x-5, x-5, 10, 10); } 
 
  fill (0); 
  size(200, 200);
 
 
  for (int y = 20; y < height; y += 20) { 
  for (int x = 20; x < width; x += 20) { 
  rect(x-5, y-5, x/20, x/20); 
  }
}

Comments

Nobody has said anything yet.