Taking the last stone wins.
Select one heap, choose how many, then Take. Tab + Enter or Space also works.
One heap per turn. Decide how many stones to take, and plan who will face the final stone.
Moves0
Left9
Taking the last stone wins.
Select one heap, choose how many, then Take. Tab + Enter or Space also works.
Nim is an impartial strategy game: both players use the same heaps and can make the same kinds of moves. Each move removes at least one stone from a single heap. Nothing is added back, so every match ends. This original browser version is free and needs no account or download.
Normal play rewards taking the last stone. Misère play reverses that ending, so a plan that wins under one rule may lose under the other. The rule stays visible while you play.
These are strategy matches, not numbered levels. Fixed starts have 3, 4 or 5 heaps: 1/3/5, 1/3/5/7 and 3/4/5/6/7 stones. Random starts use one to seven per heap. Both last-stone rules and either starting player can be used.
Easy chooses among legal moves. Optimal uses the exact Nim-sum strategy and adjusts for the all-singleton misère ending. It cannot force a win from every starting position. Settings and legal move history resume locally when storage is available.
In normal play, two equal heaps let the responding player copy each removal in the other heap. This keeps the totals paired.
With only single stones left, every turn removes one. Under Win last, an odd count favors the player to move; under Lose last, an even count does.
For normal Nim, bitwise XOR of the heap sizes identifies the position: zero favors the responding player with correct play. For misère Nim this changes when only heaps of size one remain.
No. This is multi-heap Nim with unrestricted removal from one heap per turn, with both normal and misère endings.
Two people can share one device. There are no online rooms or remote matches.
From a losing position, no strategy can force a win against perfect replies. From a winning position you can keep the advantage by making correct moves. Easy chooses random legal moves.
No. Either player may start with the theoretical advantage. Change who starts or replay a position to explore another strategy.
Only this browser stores the settings, initial heaps and legal history. No account or cross-device sync is used.
Nim permanently removes stones from one shared heap. Mancala sows a whole pit around a ring and scores seeds in separate stores.