butters
High on a Hill
- Joined
 - Jul 2, 2009
 
- Posts
 - 85,960
 
what?Every "turn", you have a current state and four moves you can make. You can predict the outcome of every move, and select the move that merges the maximum number of tiles. Obviously, this will take you further than simply moving tiles at random.
However, as you merge tiles, the high value tiles become obstacles (since they are less common). As you approach the end, the available space to move tiles around decreases. So you can't make the move that merges the maximum number of tiles every time, because it isn't necessarily the move that leads you to merge the high value tiles.
Also, you must account for the chance of merging tiles in future moves. In example:
Code:U - up, D - down, L - left, R - right U -> merge 1 D -> merge 0 L -> merge 0 R -> merge 0
Given the above, you'd think that U is the best move. However, if:
Code:U, then U -> Merge 1, then 0 U, then D -> Merge 1, then 0 U, then L -> Merge 1, then 0 U, then R -> Merge 1, then 0
and:
Code:R, then U -> Merge 0, then 2 R, then D -> Merge 0, then 1 R, then L -> Merge 0, then 0 R, then R -> Merge 0, then 0
Then the second set of moves is better.
...except new tiles are spawned randomly, so you have a probability that a second move will be better than the current move. And you need to account for third moves, and so on... *sigh*
EDIT: Oh. Also, about future moves, you need to consider not only how many tiles are merged, but also what tiles. E.g., a sequence of three moves that leads you to merge two "512" tiles is probably more desirable than a sequence of two moves that leads you to merge two "16" tiles.

can't stopppppppppppppppp



 cya T. 
 saucy