Copyright © University of Cambridge. All rights reserved.

## 'Nim-interactive' printed from http://nrich.maths.org/

This is a game of skill for two players. The rules are simple.
Start with any number of counters in any number of piles. Two
players take turns to remove any number of counters from a single
pile. The winner is the player who takes the last counter.

Can you beat the computer? You can choose the number of piles
and whether to go first or to let the computer start. Can you find
the winning strategy?

**If you can see this message Flash may not be working in your browser**
**Please see http://nrich.maths.org/techhelp/#flash to enable it.**
Both players have exactly the same information, chance plays no
part, and each game must end. There is a 'winning strategy' and all
the moves can be analysed mathematically. The only advantage that
either player can possibly have is to start or to play second. To
work out how to win you need to start by analysing the 'end game',
and the losing position to be avoided, and then work back to
earlier moves.