Wiki Headlines
It's time for the second TV Tropes Halloween Avatar Contest, theme: cute monsters! Details and voting here.

main index




Topical Tropes

Other Categories

TV Tropes Org
Game of Nim
"I know a game I always win."
"It's not much of a game if you can't lose."
"Oh, I can lose, but I always win."
Last Year at Marienbad

James Fixx described this two-player game in his 1972 book Games for the Superintelligent, although it is certainly older.

The game begins with matchsticks arranged in three rows: three on the top, five in the middle and seven at the bottom. Players take turns removing matches, from only one row at a time. The object is to force one's opponent to remove the last match.

The solution involves writing the number of matchsticks in each row in binary and making selections so that there are an even number of each binary digit, except when this would leave only single matches, in which case you want to leave an odd number of single matches.

More general versions of the game exist with different numbers and sizes of rows (or piles, as the case may be), and Reverse Nim is essentially the same game played to lose - and the solution is similar. In all cases, one side has a winning strategy that cannot be beaten if the player follows it carefully. This makes it very easy to implement in a computer game - the human player has the advantage and can win if he does the right thing, but a single slip-up and the computer will win instead.

This trope makes an appearance in:


Western Animation

Video Games
  • Honeycomb Havoc in Mario Party 2 where you have a tree with fruits, coins, and beehives set up in a row, and each of the four players can take one or two items from the tree — if you get the beehive, you're out.
  • A variety of this game made an appearance in Super Mario RPG, in which you had to make sure your opponent took the last coin from a box... Although the CPU apparently didn't know how to count, as he would often take multiple coins if there was more than one coin left, causing him to lose.
  • The Secret Island of Dr. Quandary had DiscAppear, which is a Nim variant played with compact discs with titles like "The Boston Pops Play the Beach Boys". It's implied that whoever gets stuck with the last disc has to listen to it, but fortunately the player is spared such a fate. What's not obvious at all is that the hardest difficulty level inverts the goal by changing the ingredient needed from this mini-game.
  • One EX Mission in Shin Megami Tensei: Strange Journey is to win at a counting-based variant of this game against one of your crewmates, called "Don't Count Thirty". The solution is to control every fourth number - 1, 5, 9, 13, 17, 21, 25, and 29.
  • In the Pokémon Black and White Dream World, you can play a similar game against ghost-type Pokémon, where the players take turns blowing out candles. Some candles, however, give you extra points, while others subtract them, and later ones take two turns to extinguish.
  • In Teenage Mutant Ninja Turtles: Fall of the Foot Clan for the Nintendo Game Boy, there is a bonus stage where you play a similar game against Krang by removing shurikens until there are none left, with the winner being the one who removes the last shuriken.
  • A similar game appears in the bonus chapter of the collector's edition of The Keepers: Lost Progeny. You play against the computer, with each player taking it in turns to remove between one and three daggers. Unfortunately, you can't win in ordinary play, as a) you always go first, and b) the computer follows every move by taking (4 - n) daggers, where n is the number you took. You can only "win" by playing three games - during the third, the computer will make a deliberate mistake.
  • Shows up twice in Professor Layton in Spectre's Call — first time as a puzzle involving a fountain and some valves, second time involving the hotel owner and taking the last bottle.
    • Azran Legacy has another variation.
  • Shows up as a mandatory puzzle in an amusement park in OFF, where you take turns popping balloons, picking to pop one, two, or three each turn.
  • Used in Zork Zero, like many other Stock Puzzles. Fortunately, you can cheat — the number of flowers in each corner of the screen when you're playing Nim gives you a winning move each turn.
  • The Interactive Fiction title Humbug pits you against an octopus in a game of Nim.

Fox-Chicken-Grain PuzzleStock PuzzleGrid Puzzle

TV Tropes by TV Tropes Foundation, LLC is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Permissions beyond the scope of this license may be available from
Privacy Policy