What is the optimal algorithm for the game 2048?
stackoverflow.com
stackoverflow.com
playing, i think, is NP-hard, and that makes games really addictive. see this research:
http://arxiv.org/pdf/1001.4420v3.pdf
which talks about flood filling games as being NP-hard. there's a satisfaction we get when we succeed that tickles our humanity in a unique way.
Someone revealed in that thread that you should never move down. I tried moving only up, left, and right and won easily, so the strategy is solid.
Pick a corner for the highest tile (for me: upper left). Try to keep the next highest tiles in line with it (I choose the top row). Never push the opposite direction from that (down), and only push the other "off" direction (right) if that row is full so the highest tile will stay put, or if it's the only move remaining. Try to build a "snake" with numbers in descending order, and compress it down to a single tile whenever that becomes possible.
From there, it's just little tricks -- learning when you can untrap a lower tile, or when to hold off on a move in order to set up a better one -- that bring up the win rate by a few percent here and there.
similarly, i also find that keeping the small tiles accessible - outside - helps tremendously. if you never move down you get that for free, because you never make open space on top for a 2 to come in (and not combine with your 512 or whatever).
Note that in game play if you have to you can change the forbidden direction.
And if you have to move this way you can rotate 90 degrees the forbidden direction if you must.