Skip to content

Instantly share code, notes, and snippets.

@enykeev
Last active August 29, 2015 13:57
Show Gist options
  • Save enykeev/9528061 to your computer and use it in GitHub Desktop.
Save enykeev/9528061 to your computer and use it in GitHub Desktop.
Hook2048 Algorithms
fail = 0;
i = Hook2048(function (manager, step) {
if (fail < 6) {
fail = manager.move([1,2,2,3,2,2][step%6]) ? 0 : fail + 1;
} else {
manager.move(0);
fail = 0;
}
}, function (res) {
console.log(['Ticks: '+res.ticks, 'Score: '+res.score, 'Max tile: '+res.maxTile].join(', '))
}, 50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment