Exercise 25

now let’s nest a while loop inside another while loop to give us a grid



size(400, 400);
noStroke();
background(50);

float x = 0;
while (x < width) {
  float y = 0;
  while (y < height) {
    rect(x, y, 30, 30);
    y = y + 40;
  }
  x = x + 50;
}

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *