Created
December 12, 2013 20:07
-
-
Save sighrobot/7934521 to your computer and use it in GitHub Desktop.
Generates layers of triangles with semi-random dimensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int i = 0; | |
int j = 0; | |
boolean run = true; | |
void setup() { | |
background(#ffffff); | |
size(600, 600); | |
frameRate(1000); | |
} | |
void draw() { | |
if (run) { | |
stroke(#808080); | |
strokeWeight(random(1, 10)); | |
fill(0, 0, random(63, 255)); | |
triangle(0, 0, i, 0, 0, i); | |
i++; | |
if (i == width - j) { | |
i = 0; | |
j = j + (int) random(10, 100); | |
} | |
if (j >= width) run = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment