2048 看起来只是一个把数字滑来滑去的小游戏,但它的每一条规则背后,都藏着干净利落的数学。这篇文章带你看懂三件事:为什么所有方块都是 2 的幂、理论上最大能合成多大的方块、以及顶尖 AI 是怎么"思考"的。
一切都是 2 的幂
2048 诞生于 2014 年 3 月,作者是意大利程序员 Gabriele Cirulli,最初只是他一个周末的开源练手作品,灵感来自此前的 1024 和 Threes。它的规则极简:4×4 的棋盘,每次滑动,所有方块朝同一方向移动;两个数值相同的方块相撞就合并成它们的和。
这条"相同才能合并"的规则,决定了棋盘上只会出现 2 的幂。游戏开局只生成 2(90% 概率)或 4(10% 概率)——都是 2 的幂。两个 2 合成 4,两个 4 合成 8……任意两个相等的 2 的幂相加,结果必然还是 2 的幂(因为 2ⁿ + 2ⁿ = 2ⁿ⁺¹)。于是棋盘上永远不可能出现 6、12 或任何非 2 的幂的数字。你拼出的"2048",其实就是 2¹¹。
最大能合成多大?
很多人以为通关 2048 就到顶了,其实远没有。棋盘有 16 个格子,理论上你可以继续合成 4096、8192、16384、32768、直到 65536(2¹⁶)。
一个漂亮的上限
如果只考虑生成的"2",要凑齐一个 65536,需要整个棋盘排满由小到大的 2 的幂——这正好能填满 16 格。而由于游戏偶尔会生成"4",理论上的绝对上限可以达到 131072(2¹⁷),但这要求近乎完美的运气与操作,几乎只存在于理论与 AI 的世界里。
对人类玩家来说,能稳定拼出 2048 已经不错,4096 是高手线,8192 则需要非常自律的策略。
最优策略:把最大数钉在角落
几乎所有高分打法都遵循同一个核心原则:选定一个角,让你最大的方块永远待在那里。围绕它,让数字沿着一条边由大到小排成一条"阶梯"(也叫蛇形排列)。这样做的好处是:
- 合并方向单一。你主要只用两个方向(比如"左"和"下"),尽量不去碰会让最大数离开角落的方向。
- 保持单调性。一行或一列里数字始终由大到小,相邻的方块更容易凑成可合并的一对。
- 留出呼吸空间。不要见到能合并就合并,有时保留空格比眼前的合并更重要。
新手最常见的失误,就是频繁地按"上",把辛苦垒在底部的大数冲散——记住你的角落,少用那个会破坏布局的方向。
AI 是怎么玩的?
因为每一步之后系统会随机生成新方块,2048 不是井字棋那样的确定性博弈,而是一个带随机性的决策问题。所以最有效的 AI 用的不是普通的 minimax,而是它的"随机版"——expectimax(期望极大):玩家的回合取收益最大的走法,随机生成的回合则取所有可能结果的期望值。
真正决定 AI 强弱的,是它评估局面的"启发函数",通常综合几项指标:空格数量(越多越灵活)、单调性(数字是否有序排列)、平滑度(相邻方块差距是否小)、以及最大数是否在角落。把这些指标加权打分,再用 expectimax 向前搜索几步,一个普通的 AI 就能稳定突破 8192,甚至触及 16384。
下次你滑动方块时,不妨想想:你其实正在用直觉,做着和 expectimax 一样的事——在确定的操作与不确定的运气之间,寻找期望最高的那一步。
2048 looks like a simple game of sliding numbers around, but every one of its rules hides some crisp mathematics. This article unpacks three things: why every tile is a power of two, how large a tile can theoretically become, and how the best AIs actually "think".
Everything is a power of two
2048 was created in March 2014 by Italian developer Gabriele Cirulli — originally just an open-source weekend project, inspired by the earlier games 1024 and Threes. The rules are minimal: on a 4×4 board, every swipe slides all tiles in one direction, and two tiles of the same value merge into their sum.
That "same value only" rule is exactly why the board only ever shows powers of two. The game spawns only a 2 (90% of the time) or a 4 (10%) — both powers of two. Two 2s make a 4, two 4s make an 8, and so on. Adding any two equal powers of two always yields another power of two, because 2ⁿ + 2ⁿ = 2ⁿ⁺¹. So a 6 or a 12 can never appear. The "2048" you are chasing is simply 2¹¹.
How big can a tile get?
Many people assume reaching 2048 is the ceiling. It is not. With 16 cells you can keep going: 4096, 8192, 16384, 32768, all the way to 65536 (2¹⁶).
An elegant limit
Using only spawned 2s, building a single 65536 requires the whole board to hold an ascending run of powers of two — which fits exactly into 16 cells. Because the game occasionally spawns a 4, the absolute theoretical ceiling rises to 131072 (2¹⁷), but that demands near-perfect luck and play and lives mostly in the world of theory and AIs.
For human players, reliably reaching 2048 is solid, 4096 marks an expert, and 8192 requires very disciplined strategy.
Optimal play: pin the biggest tile in a corner
Almost every high-scoring approach follows the same core principle: pick one corner and keep your largest tile there forever. Around it, arrange the numbers in a descending "staircase" (also called a snake ordering) along one edge. The benefits:
- One merge direction. You mainly use two directions (say left and down) and avoid the one that would pull the biggest tile out of its corner.
- Keep monotonicity. When a row or column always decreases, neighbouring tiles line up into mergeable pairs.
- Leave room to breathe. Don't merge just because you can — sometimes an empty cell is worth more than an immediate combine.
The most common beginner mistake is pressing "up" too often, scattering the big tiles you carefully stacked at the bottom. Remember your corner, and avoid the direction that breaks your layout.
How does an AI play?
Because a new tile spawns randomly after every move, 2048 is not a deterministic game like Tic-Tac-Toe — it is a decision problem with chance baked in. So the most effective AIs don't use plain minimax but its probabilistic cousin, expectimax: on the player's turn it takes the highest-scoring move, and on the random spawn's turn it takes the expected value across all possible outcomes.
What really sets a strong AI apart is its board-evaluating heuristic, usually a blend of: number of empty cells (more is more flexible), monotonicity (are values ordered?), smoothness (are neighbours close in value?), and whether the biggest tile sits in a corner. Weight those signals, search a few moves ahead with expectimax, and a modest AI reliably blows past 8192 — even brushing 16384.
Next time you swipe, consider this: your intuition is doing the same thing expectimax does — searching, between certain moves and uncertain luck, for the step with the highest expected payoff.
想亲手试试?Want to try it yourself?
用角落策略挑战你的 2048 新纪录。Put the corner strategy to work and beat your 2048 record.