Skip to content

Instantly share code, notes, and snippets.

@brysonian
Created October 6, 2017 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brysonian/d6071f0e22c2b250752902c6e8c2a0da to your computer and use it in GitHub Desktop.
Save brysonian/d6071f0e22c2b250752902c6e8c2a0da to your computer and use it in GitHub Desktop.
Inset Boxes
int inset = 20;
int cellCount = 7;
void setup() {
size(500, 500);
noFill();
}
void draw() {
background(255);
stroke(0);
for (int i=1; i <= cellCount; i++) {
int x = inset * i;
int y = inset * i;
rect(x, y, width - x * 2, height - y * 2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment