This visualization shows the loop progressing one loop at a time.
for (let x = 0; x <= width; x += 100) {
for (let y = 0; y <= height; y += 100) {
ellipse(x + 50, y + 50, 100);
}
}
The next visualization shows how different paremeters update the loop.
Here's a similar example using the translate
function instead of the x
and y
coordinates.