Follow TV Tropes

Following

Context Main / GameOfNim

Go To

1->''"I know a game I always win."''\
2''"It's not much of a game if you can't lose."''\
3''"Oh, I can lose, but I always win."''
4-->-- ''Film/LastYearAtMarienbad''
5
6James Fixx described this two-player game in his 1972 book ''Games for the Superintelligent'', although it is certainly older, appearing in the 1961 French film ''Film/LastYearAtMarienbad''.
7
8The 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 objective is to remove the last match.
9
10The solution involves writing the number of matchsticks in each row in binary and making selections so that there is an even number of each binary digit.
11
12One popular variant (aka ''misère nim'') requires one to force one's opponent to remove the last match.
13
14Follow the aforementioned strategy, except when this would leave only single matches, in which case you want to leave an odd number of single matches.
15
16More general versions of both games exist with different numbers and sizes of rows (or piles, as the case may be). In all cases, depending on the starting position[[note]]If there is a valid move according to the strategy above, it's the player who goes first. Otherwise, it's the player who goes second.[[/note]], either one side or the other can follow the strategies above, and cannot be beaten if the player follows it carefully. If they make a mistake, the other player may take over with said strategy. This makes it very easy to implement in a computer game--the human player has the advantage and can win if they do the right thing, but a single slip-up and the computer will win instead.
17----
18!!This game makes an appearance in:
19
20[[AC:Anime & Manga]]
21* ''Anime/YuGiOhFirstAnimeSeries'': Dark Yugi challenges the school's AlphaBitch Kaoruko Himekoji to ''misère nim''. Instead of matchsticks, they use the flowers on the latter's [[ExactWords person]]. As usual, Dark Yugi pulls a come-from-behind victory--while his opponent focuses entirely on the bouquet she was holding, she forgets she has an extra flower in her hair. As an added element of HoistByHisOwnPetard, Yugi figures out that it's Kaourko who attacked and chloroformed his friend Miho; the rose petals he found near Miho fell from the exact same rose he pulled to win the game.
22-->'''Dark Yugi''': I said all the flowers you had. I never said ''just'' the bouquet.
23
24[[AC:Fan Works]]
25* ''VideoGame/HOME2013'': The game of Nim in the park from ''VideoGame/{{OFF}}'' is now a game where you throw birds at balloons. The birds explode into a squirt of blood when they hit the wall.
26
27%%[[AC:Films -- Live-Action]]
28%%* ''Film/LastYearAtMarienbad'': "M" describes it as "a game I always win", and "X" never figures out the trick. It's considered to be the TropeMaker. %%Example needs explanation to make sense on its own.
29
30[[AC:Live-Action TV]]
31* ''Creator/DaraOBriain's School Of Hard Sums'': Yucky Choccy is played with a tray of chocolates and a chilli pepper.
32* ''Series/FortBoyard'': One of the challenges against the Masters of Time involves a game of Nim.
33* ''Series/SquidGame'': In [[Recap/SquidGameS1E6Gganbu "Gganbu"]], the objective is to pick a game that involves marbles and play it with one's partner. The characters win if they manage to win over all ten of their partner's marbles. Gi-hun convinces a senile Il-nam to play a game of Nim with the marbles. In the first round, Gi-hun loses as he's the one holding the last marble; desperate, he guiltily exploits Il-nam's lapse in lucidity to win.
34
35[[AC:{{Magazines}}]]
36* ''Scientific American'': Yucky Choccy, a version involving a bar of chocolate, the corner chunk of which is soap, so the loser is the person who has to eat the soap, is [[http://www.whydomath.org/Reading_Room_Material/ian_stewart/chocolate/chocolate.html described]] in one of Ian Stewart's maths columns.
37
38[[AC:Tabletop Games]]
39* ''[[http://www.boardgamegeek.com/boardgame/23630/ The Amazing Dr. Nim]]'': It's a marble track with several gates that can either allow marbles to pass or block them. To beat it, it includes an "equalizer" gate. When set to on, this causes it to make a single non-optimal play over the course of the game, allowing a perfect human player to win an otherwise unwinnable game.
40
41[[AC:Video Games]]
42* ''VideoGame/BecomeThePirateKing!'': It adapts Mihawk's CurbstompBattle against Zoro at the Baratie. The matchsticks represent how many ([[HopelessBossFight ineffectual]]) attacks each player makes against him; whoever's stuck making the thirtieth attack loses, and gets [[NotQuiteDead chopped down to 1 HP]] by his counterattack. Things are spiced up by a limited-use Special Attack mechanic (a UsefulNotes/RandomNumberGenerator that may let you make anywhere up to nine attacks) and occasional power-ups that either let you skip a turn or add an extra attack opportunity.
43* ''VideoGame/ClubhouseGames'': Rebranded as 'Last One', is one of the games included, although as a Japan-exclusive. It's played as originally, with matchsticks in three rows.
44* ''VideoGame/CursedTrilogy'': In the second game, Randall plays a version of the game with a cloaked figure. There is a set of marbles on the table, either player can take up to four at a time, you choose who goes first, and if the figure takes the last marble you die. [[spoiler:The answer is to let the figure go first, then take marbles on each of your turns so that the total marbles taken between their turn and yours is 5.]]
45* ''VideoGames/{{Humbug}}'': This InteractiveFiction title pits you against an octopus in a game of Nim.
46* ''VideoGames/TheKeepersLostProgeny'': In the bonus chapter of the collector's edition, you play against the computer. Each player takes turns to remove between one and three daggers. Unfortunately, [[spoiler: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 [[ArtificialStupidity deliberate mistake]]]].
47* ''VideoGame/MathWorkshop'': One of the puzzles is a game of Nim that replaces the matchsticks with toy rockets arranged in three rows. The goal is to be the one who launches the last rocket.
48* ''VideoGame/{{OFF}}'': A mandatory puzzle in the amusement park of Zone 2 has you and your opponent take turns popping balloons, picking to pop one, two, or three each turn.[[note]]The trick is not to get stuck with five balloons.[[/note]]
49* ''VideoGame/PokemonBlackAndWhite'': In the Dream World, you can play a 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.
50%%* ''VideoGame/ProfessorLayton: Spectre's Call'':
51%%** One puzzle involves a fountain and some valves.
52%%** Another involves the hotel owner taking the last bottle. %%Example needs explanation to make sense on its own.
53* ''VideoGame/TheSecretIslandOfDrQuandary'': [=DiscAppear=] is a Nim variant played with compact discs [[StylisticSuck with titles like "The Boston Pops Play the Beach Boys"]]. It's implied that whoever gets stuck with the last disc [[CoolAndUnusualPunishment has to listen to it]], but fortunately the ''player'' is spared such a fate. What's not so obvious is that the hardest difficulty level [[MisereGame inverts the goal]] by changing the ingredients needed from this mini-game.
54* ''VideoGame/ShinMegamiTenseiStrangeJourney'': One EX Mission consists of winning at a counting-based variant of this game. Facing one of your crewmates you play "Don't Count Thirty". The solution is [[spoiler:to control every fourth number--1, 5, 9, 13, 17, 21, 25, and 29.]]
55%%* ''VideoGame/SpaceRangers'': This is one of the text quests concerning game tournaments. Like other {{stock puzzle}}s, it provides galactic prestige for winning. %%Example needs explanation to make sense on its own.
56* ''Franchise/SuperMarioBros'':
57** ''VideoGame/MarioParty2'': In the minigame Honeycomb Havoc, 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.
58** ''VideoGame/SuperMarioRPG'': You have to make sure your opponent takes the last coin from a box. Although the [[ArtificialStupidity CPU apparently doesn't know how to count]] because it often takes multiple coins if there's more than one coin left, causing it to lose.
59* ''VideoGame/TalesSeries'':
60** ''VideoGame/TalesOfPhantasia'': There is an NPC in Alvanista Castle who will challenge you to a "subtraction game" in which players take turns removing 1, 2, or 3 rocks from a pile. Whoever takes the last one is losing. It's made extra difficult because the player has only 3 seconds to choose a number. Should you win though, the NPC will give you a combat accessory, though to get that in the [=PS1=] version you will also have to play a second round with a much bigger pile of rocks. You will also get a title for Cress for winning the harder variant.
61** ''VideoGame/TalesOfEternia'': You can play an "arithmetic contest" MiniGame against a {{NPC}} in Barole that is basically the Game of Nim. It has the additional rule that no more than three tokens can be taken per turn, though. Winning will unlock the "Mathematician" title for Reid, which is kinda deserved because the dev team seems to have implemented a perfect-play algorithm and the game will win if the player makes a single mistake starting with the question, "Who goes first?".
62* ''VideoGame/TeenageMutantNinjaTurtlesFallOfTheFootClan'': In a bonus stage, you play a game of Nim against Krang by removing shurikens until there are none left, with the winner being the one who removes the last shuriken.
63* ''VideoGames/ZorkZero'': One of the puzzles is a game of Nim in which the matchsticks get replaced by flowers arranged in rows. Fortunately, you can cheat--[[spoiler:the number of flowers in each corner of the screen when you're playing Nim gives you a winning move each turn]]. This too is one of the puzzles in ''VideoGame/{{Zork}}''.
64
65[[AC:Webcomics]]
66* ''Webcomic/SkinHorse'': This is one of the OnlySmartPeopleMayPass puzzles in the Whimsyworld VR. A crow in Future World has [[http://skin-horse.com/comic/canine-supervisor/ twenty spheres]] and challenges you to take the last one. Baron Mistycorn [[http://skin-horse.com/comic/under-the/ comes up with a solution]]; they uses their recently acquired ability to duplicate objects to ... create a whole bunch of guns and point them at the puzzle setter, whose response is "Nice. Very [[CuttingTheKnot Gordian]]."
67
68[[AC:Websites]]
69* ''Website/{{TED}}'': The [[https://www.youtube.com/watch?v=qMFpOcLroOg&list=PLJicmE8fK0EiFRt1Hm5a_7SJFaikIFW30&index=26 "Rogue AI Riddle"]] pits the player against an {{AI}} in a variant of the game. You start on top of 25 meters of electrified water while Nim starts at the bottom. Both players must lower the water level to exactly 0 on their turn, and can only lower the water levels by 1, 3, or 4 levels.
70[[AC:Western Animation]]
71* ''WesternAnimation/{{Cyberchase}}'': In [[Recap/CyberchaseS1E18ProblemSolvingInShangriLa "Problem-Solving in Shangri-La"]], both the kids and [[BigBad Hacker]] have to win two out of three games of him before they can leave. Shangri-La being a LandOfDragons, it's played with sentient mini-Terracotta warriors and [[[[DragonsUpTheYinYang dragons]]. They all struggle to find the winning strategy until Jackie realizes to solve the last move and work back from there to control previous turns.
72
73%%[[AC:Real Life]]
74%%* It's possible to use this game to win money in bars. After all, you're guaranteed a win if you know the winning strategy.
75%%** A "better" variant, which can truly befuddle your opponent, is to ask your opponent to lay out as many matches as they want, split into as many piles as they want, while you decide whether to go first or second. Once again, the winning strategy is given above.

Top