NIM ZERO

NIM ZERO · 2026.08.01-v1

Nim rules: how to play the classic heap game

In Classic Nim, players alternate removing one or more pieces from exactly one heap. You may empty that heap, but you may not touch a second heap in the same turn. The player who removes the final piece wins.

A legal turn

Choose one non-empty heap and reduce its count by any positive whole number. From 3–5–7, taking two from the middle heap makes 3–3–7. Taking from both the middle and final heap would be illegal.

How the game ends

The board ends only when every heap is zero. Classic Nim awards the win to the player who made that final removal; Misère Nim reverses only that last-piece result.

Worked position

HeapBinary10
10113
21015
3111 → 1107 → 6
nim-sum001 → 0001 → 0

Method and source

Method: finite legal moves are exhaustively checked by Nim Zero’s pure rules engine. Mathematical source: C. L. Bouton, “Nim, A Game with a Complete Mathematical Theory,” Annals of Mathematics, Second Series 3, no. 1/4 (1901–1902), 35–39.

DOI: 10.2307/1967631 · 2026-08-01

Back to the game