A magazine where the digital world meets the real world.
On the web
- Browse by date
- Browse by topic
- Enter the maze
- Get our RSS feed
- Follow us on Twitter
- Resources for teachers
What is cs4fn?
- About us
- Contact us
- Privacy and cookies
- Copyright and contributions
- Links to other fun sites
- Complete our questionnaire and get a free magic download
How to play Nim
Nim is really easy to play and you can play it anywhere. All you need is something to use as counters, like pebbles or coins (or hamsters if you have enough and can train them to stay put).
1. Make a series of piles of hamsters. It doesn't matter too much how many piles or how many hamsters are in each, though classic NIm uses piles of 3, 4 and 5 so we will start like that.
2. Each player takes it in turns to take some hamsters from any one pile.
3. The person who takes the last hamster wins.
An example game might go:
At the start the piles have the following number of hamsters: 4, 5 and 3 hamsters.
Player 1 takes 2 hamsters from the pile of 5, leaving piles of: 4, 3 and 3 hamsters.
Player 2 takes 4 hamsters from the pile of 4 leaving piles of: 3, 0 and 3 hamsters.
Player 1 takes 2 hamsters from a pile of 3 leaving piles of: 1, 0 and 3 hamsters.
Player 2 takes 2 hamsters from the pile of 3 leaving piles of: 1, 0 and 1 hamsters.
Player 1 takes 1 hamster from a pile of 1 leaving piles of: 1, 0 and 0 hamsters.
Player 2 takes the last hamster and wins.
Our "Hamster Nim" is a fun (if slightly silly) way to play. You can watch the computer thinking as it plays.