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.png2048
191–200 of 423 posts
Re: 2048
#192Hey, author here! I'm pretty overwhelmed that this made it to the top of HN without me even thinking of posting it here :) I made this game as a fun weekend project, inspired by another game called 1024 ( https://itunes.apple.com/us/app/1024!/id823499224 ) and a spinoff called 2048 ( http://saming.fr/p/2048/ ). I did mine to add animations to the latter, which was a bit hard to play without them. I discovered Threes…
Upvoted you to show my anger! :)
Re: 2048
#193Also, protip: to get high score choose one direction that you will never push towards. You'll end up with a gradient of high value tiles on one side, lower on the other, which desirable.
Re: 2048
#194 2048 (gabrielecirulli.github.io)
1337 points by frederfred 8 hours agoRe: 2048
#195I decided to take a look just because I saw this: 2048 (gabrielecirulli.github.io) 1337 points by frederfred 8 hours ago
Re: 2048
#196Re: 2048
#197Earlier quoted context omitted.
You definitely need to have some kind of counter for how many times someone has reached 2048, and out of how many games played.
Or an expansion on that. Keep track of how many 128s, 256s etc you've ever formed. Show them as big counters directly under the game with an animation when you create any of them.
Edit:
Actually all you need to store is the highest block achieved, and the number of times it's been hit. For instance, if you've only ever generated 2 8's, then you know that you've had 4 4's, and 8 2's...
Edit 2: Does the game allow four 2's to cascade into an 8? If so, maybe you could also store combo stats. It'd be way cooler to smash together four 256's than to smash together two 256's two times.
Not sure how that plays into the histogram.
Re: 2048
#198Earlier quoted context omitted.
I'm gonna call fake on this one.
There's actually a semi-optimal strategy that nearly guarantees winning if you're diligent about it. Just build a stairstep pattern with the highest numbers in the bottom corner of the stairs. Then basically combine sideways and downward and "always" resist the temptation to push up. Its kind of how some tri-diagonal matrix algorithms work. The only problem is you have to be fastidious about never using the one direc…
Re: 2048
#199http://hnplays2048.herokuapp.com/
Check it out! Or clone it! https://github.com/grant/hnplays2048