Last active
February 27, 2020 02:14
-
-
Save dropmeaword/4d09e2ce7b47c48b24971da1503d8b35 to your computer and use it in GitHub Desktop.
a tiny processing sketch that generates Mondrianesque compositions (in 287 characters)
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,j;color clr=#ff0000;void I(int a,int b,int c,int d,int N){if(N==0){fill(clr);clr<<=2;clr%=0xffffff;rect(a,b,c-a,d-b);}else{i=int(random(a,c));j=int(random(b,d));I(a,b,i,j,N-1);I(i,b,c,j,N-1);I(a,j,i,d,N-1);I(i,j,c,d,N-1);}}void draw(){background(#1356A2);I(-1,-1,width,height,2);} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment