Nim

Two piles, optimal play. The AI always leaves you a losing position.

Board & cardsStrategyMath
Nim screenshot
Position
Stones
0
XOR
0
Click any stone to take that many from its pile. The AI plays the Sprague-Grundy reply, so it never hands you a losing position.

A single pile of n has Grundy value n, so the sum of piles is their XOR. XOR 0 is a losing position for whoever is on move. Take the whole pile to win.

More games