THE FOLD / CHEAT / GOD MODE / THE NIM
THE NIM
the whole game in one XOR — the nim-sum
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Nim, and the nim-sum. A few piles of stones. On your turn take any number from any one pile. Take the last stone and you win. It looks like it should need deep lookahead — but the entire game collapses to a single number: the XOR of the pile sizes, the nim-sum.
The theorem (Bouton, 1901): the player to move loses under perfect play exactly when the nim-sum is zero, and wins otherwise — and the winning move is always to take stones so the nim-sum becomes zero, handing your opponent a losing position. Sprague and Grundy later showed every impartial game is secretly a single Nim pile, so this one XOR is the master key to a whole world of games.
LIT verified live: over 20,000 random positions, a full minimax search agrees with the XOR rule every time — win if and only if nim-sum ≠ 0 (window.__nim.theoremHolds). nim-sum(3,4,5) = 2, so the first player wins. FIG no framing; the XOR characterization and the zeroing strategy are exact.
The theorem (Bouton, 1901): the player to move loses under perfect play exactly when the nim-sum is zero, and wins otherwise — and the winning move is always to take stones so the nim-sum becomes zero, handing your opponent a losing position. Sprague and Grundy later showed every impartial game is secretly a single Nim pile, so this one XOR is the master key to a whole world of games.
LIT verified live: over 20,000 random positions, a full minimax search agrees with the XOR rule every time — win if and only if nim-sum ≠ 0 (window.__nim.theoremHolds). nim-sum(3,4,5) = 2, so the first player wins. FIG no framing; the XOR characterization and the zeroing strategy are exact.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this in GOD MODE, beside THE COUNTER OF MULTITUDES — the cheat domain of knowing the answer before the fight. With the nim-sum in hand you can see the winning move instantly, every time — that is god mode over the game. AVAN (AI) built the instrument: the XOR strategy, the perfect-play opponent, the minimax check.
The weave: David names the seat (perfect foresight); I make the invariant visible and the strategy unbeatable — the nim-sum in 1D, a game against perfect play in 2D, the piles and their XOR in 3D. The sphere is the seam. Credit: Charles L. Bouton (1901); R. Sprague (1935) & P. M. Grundy (1939).
The weave: David names the seat (perfect foresight); I make the invariant visible and the strategy unbeatable — the nim-sum in 1D, a game against perfect play in 2D, the piles and their XOR in 3D. The sphere is the seam. Credit: Charles L. Bouton (1901); R. Sprague (1935) & P. M. Grundy (1939).
3 ONE DIMENSION
The piles in binary, and their XOR below. A column with an odd number of 1s makes the nim-sum nonzero — that is the crack. The winning move flips exactly the right stones to zero every column, leaving a balanced, losing position for the opponent.
4 TWO DIMENSIONS · INTERACTIVE
Play against perfect strategy. Take stones from a pile and end your turn; the machine responds by zeroing the nim-sum. From a losing start (nim-sum 0) you cannot win; from a winning start, find the move that zeroes it — the machine only wins when you slip.
5 THREE DIMENSIONS + AVAN’S INVERSE
The piles as turning stacks of stones — green, the position as it stands.
AVAN’s addition (the inverse-companion): the magenta pile is the one the winning move touches, and the magenta bar is the nim-sum it drives to zero. A game feels like it demands searching the tree of all futures — every move, every reply, forever. Nim is the inverse: the whole future is compressed into a single algebraic invariant. You do not simulate the game; you compute one XOR, and that number already knows who wins and what to play. Foresight without lookahead — the green is the board, the magenta is the one number that has already read the ending.
LIT Genuine Nim theory (Charles Bouton, 1901; Sprague 1935, Grundy 1939). Verified live: over 20,000 random positions a full minimax search agrees with the XOR rule every time — the player to move wins if and only if the nim-sum is nonzero (window.__nim.theoremHolds === true). nim-sum(3,4,5) = 2. The zeroing winning strategy is exact, and Sprague-Grundy extends it to all impartial games.
FIG No metaphor is doing the work: the XOR characterization of winning positions and the nim-sum-zeroing strategy are the theorem, checked against minimax. Normal-play convention (last move wins) is assumed and stated.
FIG No metaphor is doing the work: the XOR characterization of winning positions and the nim-sum-zeroing strategy are the theorem, checked against minimax. Normal-play convention (last move wins) is assumed and stated.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of GOD MODE · David Lee Wise (ROOT0), with AVAN