Comment by Link-
11 years ago
Quick and dirty 'dumb' solver (might require manual intervention sometimes):
var manager = new GameManager(4, KeyboardInputManager, HTMLActuator);
// Pattern definition (0: Up, 1: Right, 2: Down, 3: Left)
var pattern = [1, 2, 3, 2];
// Pattern Repeater
var i = 0;
// Interval
var solverInterval = window.setInterval(function() {
// Check if game is over
if (manager.over)
clearInterval(solverInterval);
// Repeat pattern
if (i % pattern.length == 0)
i = 0;
// Execute the move
manager.move(pattern[i]);
i++;
}, 200);
Best pattern found so far is "var pattern = [1, 0, 3, 0];" I reached 1024 with it. https://dl.dropboxusercontent.com/u/21387598/1024-Best.png
No comments yet
Contribute on Hacker News ↗