Skip to content

Instantly share code, notes, and snippets.

@dropmeaword
Last active February 27, 2020 02:14
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 dropmeaword/4d09e2ce7b47c48b24971da1503d8b35 to your computer and use it in GitHub Desktop.
Save dropmeaword/4d09e2ce7b47c48b24971da1503d8b35 to your computer and use it in GitHub Desktop.
a tiny processing sketch that generates Mondrianesque compositions (in 287 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