I'll say it again: the 2048 game is horribly addictive. Luckily for my productivity, though, I've been playing a lot less of it since I finally managed to complete the game's main goal: combine and double-up like-numbered tiles until you create the ultimate 2048 tile:
My strategy? Play the game like Tetris. Only move tiles down, left, and right and attempt to collect the largest tiles at the bottom. It is possible get into situations where you can only move up, which is likely to place an inaccessible low value tile at the bottom of the grid, but if you can avoid that situation you can get consistently high scores. This StackOverflow thread suggests some other strategies.
If you want to test out your own strategy, Mark Patterson has developed a neat framework in the R language to do so. You just need to write your own algorithm to make a move from the current state of the board, and Mark's script will go to the 2048 website, play a game according to your algorithm, and report back your score. It does this using the RSelenium package, which allows R to remotely control web pages. Its main use is for automated testing of Web applications, but here Mark uses it to play a game. Clever!
For those of you who have mastered 2048 and are looking for another fix, I recommend the Threes iOS game. It's very similar to 2048, but more difficult because the first pair you make in the sequence is a 1 and a 2, to make a 3. The fact that you have to match different tiles to begin adds another layer of complexity to the game.
Similar strategies apply to Threes as do for 2048, though. To get a sense of a "baseline" score for Threes, data scientist and co-founder of Datascope Mike Stringer simulated the "control" strategy of randomly swiping left, right, up and down and found the following distribution of scores:
Mike used a similar technique to Mark's to simulate the games, using Python to drive a web-based clone of Threes. Mike was also kind enough to compare a Tetris strategy (randomly move left, right and down, but never up) to this control, but a Kolmogorov-Smirnov test in R found no significant difference between the score distributions. Still, my high score in Threes (if I may brag) is 32,976 using a variant of this method, so I still think there's something to it. (Mostly I move left/right/down, but occasionally up if absolutely necessary or to match a stuck low-value tile near the bottom.)
Anyone else got good strategies for Threes or 2048?
I've actually taken (well, wasted) the time to write some R code which takes your move command via readline() and spits an ASCII display of the board into the console. Being the nice guy I am, I even allow the player to quit and save the game state and score. :-).
Anyone who would like this code, just drop me an email at [email protected].
Yes, I'm way too lazy to write a graphic display, animated or not!
Posted by: Carl Witthoft | May 03, 2014 at 14:30