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;
}
Leave a Reply