Skip to content

Instantly share code, notes, and snippets.

@DEGoodmanWilson
Last active August 29, 2015 13:57
Show Gist options
  • Save DEGoodmanWilson/9500145 to your computer and use it in GitHub Desktop.
Save DEGoodmanWilson/9500145 to your computer and use it in GitHub Desktop.
/******
This algorithm, when followed, will generally score between 3,000 and 4,000 points.
How it works:
The inner loop of alternating left-then-down sorts incoming blocks into a gradient, with largest value blocks in the lower left.
After a while, the top-left to bottom-right diagonals need to be collapsed; This is accomplished with the right-then-down.
The timing of the right-then-down could probably be heavily optimized. The outer up-then-down is to avoid a condition where you
can get stuck forever if all the bottom rows are full.
******/
while(1)
{
while(!stuck)
{
while(!stuck) //This is the condition most likely to yield good results if optimized
{
left();
down();
}
right();
down();
}
up();
down();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment