Skip to content

Instantly share code, notes, and snippets.

@claytical
Created September 28, 2015 22:14
Show Gist options
  • Save claytical/5c2bc3ac46c9e78c0c64 to your computer and use it in GitHub Desktop.
Save claytical/5c2bc3ac46c9e78c0c64 to your computer and use it in GitHub Desktop.
Nested For Loop Example
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background(0);
noFill();
stroke(255);
for (var x = 0; x < width; x+=5) {
for (var y = 0; y < height; y+=5) {
rect(x, y, 2, 2);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment