Twenty48 Solver

Heuristic expectimax solver for the game 2048.

About this tool

Play with the arrow buttons or focus the board and use the arrow keys. Suggest move evaluates the current position without changing it; Auto-play searches and plays repeatedly. Pause, a manual move, editing settings or leaving the tool stops it. Reaching 2048 pauses once; you can continue playing.

Enter a board accepts 16 integers in four rows, separated by spaces, commas or semicolons: 0 for empty cells, otherwise powers of two from 2 to 1073741824. Use board resets the move counter and score, which counts merges made here. Invalid input leaves the current board unchanged. A new game starts with two random tiles. Only a move that changes the board creates a new tile, uniformly in an empty cell: 90% value 2 and 10% value 4.

Expectimax alternates player choices and random spawns, considering every empty cell equally. Depth counts these alternating levels; depth 6 covers three player moves and three spawns. A job evaluates at most 60000 nodes in a background worker. Only a fully completed depth chooses the recommendation; a limit notice identifies a shallower result. This is a heuristic, with no guaranteed optimal move or win probability. The evaluation combines free cells, monotonicity, smoothness, largest tile and a corner preference. Move delay is the pause after the search and move, not a guaranteed frame rate.

Game state and draft settings remain in memory while navigating this page; reloading discards them. Hidden tools stop their search and timers. The browser must permit module workers for AI; manual play stays available. Rules: original 2048 game.