Skip to content

Instantly share code, notes, and snippets.

@johnlinvc
Created August 30, 2012 06:52
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 johnlinvc/3523502 to your computer and use it in GitHub Desktop.
Save johnlinvc/3523502 to your computer and use it in GitHub Desktop.
typedef struct {
int x,
int y,
int width,
int height
} rect;
static int count = 1;
void spiltAndMerge(rect rec){
if(count >= 272) return ;
rect new1 , new2;
RandomSpiltRect(rec,new1,new2); //random decide a spilt point and draw animation
count++;
spiltAndMerge(new1);
spiltAndMerge(new2);
MergeRect(new1,new2);
count--;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment