Skip to content

Instantly share code, notes, and snippets.

@n1ckfg
Last active August 28, 2022 15:56
Show Gist options
  • Select an option

  • Save n1ckfg/b18922b75644df405f314b66d3598b8f to your computer and use it in GitHub Desktop.

Select an option

Save n1ckfg/b18922b75644df405f314b66d3598b8f to your computer and use it in GitHub Desktop.
// https://openprocessing.org/sketch/20534/#
int dim = 50;
int interval = int(dim * 0.4);
void setup() {
size (500, 500);
println(dim + ", " + interval);
noStroke();
}
void draw() {
for (int h = 0; h < width; h += dim) {
for (int v = 0; v < height; v += dim) {
if ((h + v) % interval == 0) {
fill(150, 0, 0);
} else {
fill(0);
}
rect (h, v, dim, dim);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment