NormalPerfect computerLeft 16Your turns 0
Take the last object to win
Choose a heap to begin.
You start. Select one heap, then choose how many to take.
Four heaps. One choice each turn. Leave the last move to the right player.
Changing either setting starts a new game. You always start.
How to play
- Start with heaps of 1, 3, 5 and 7 objects. You and the Computer alternate turns. Take any positive number from exactly one heap; you may empty it. You cannot pass.
- Normal: whoever takes the last object wins. Misère: whoever takes the last object loses.
- Select a heap, set a quantity, then press Take. Dashed gold outlines preview the objects you will remove. Take all sets the quantity; press Take to confirm.
- Perfect computer uses nim-sum (bitwise XOR), leaving zero whenever it can in normal mode. In misère it adjusts the endgame to leave an odd number of one-object heaps. It makes no strategic mistakes, but cannot force a win from a losing position against perfect play.
- Easy computer does not use nim-sum: it chooses a nonempty heap uniformly at random, then a quantity uniformly from 1 to that heap's size. The fixed starting heaps are never rigged or shuffled.
Keyboard: Tab and Enter/Space operate buttons. Outside settings and the number field, 1–4 select heaps A–D; ←/→ adjust the quantity; N starts again. Tab to Take to confirm. Escape clears your selection. The number field also supports its usual arrow keys.
