Monte Carlo

Ancient strategy. Modern cats.

Monte Carlo is a game of misère Nim — the variant of the ancient mathematical game in which the player who takes the last piece loses. The board is a row of sixteen cats. The rule is simple. The strategy is two thousand years old. The phone in your pocket makes it new.

Play Solo against a computer that plays the perfect mathematical strategy, or against one that lets you find your way. Play Versus with a friend who joins instantly through their browser — no app for them to install, no account for either of you to create.

The Game Rules

The board always starts with four columns of cats

1  ·  3  ·  5  ·  7

Sixteen cats in total, arranged from a single sentinel on the left to a small crowd on the right. The first player decides whether they want to move first or yield the opening to their opponent — a choice that matters more than it appears.

Players take turns

On your turn you must remove one or more cats from a single column only. Cats are always taken from the top down of that column.

The player who is forced to take the very last cat on the entire board loses. Your goal is to leave exactly one cat for your opponent.

How to move

Press and hold any cat, then swipe up or sideways. Everything from the cat you touched upward will fly off the screen. In Solo mode the computer responds immediately. In Versus mode your move is broadcast to your opponent's browser within milliseconds.

Two computers to play against

The Smart Computer plays the mathematically optimal strategy, with the special misère adjustment for the endgame. It is very difficult to beat. If you play it from the standard opening position, you cannot beat it — the position is a losing one for whoever moves first against perfect play. This is one of the more counterintuitive truths of the game.

The Dumb Computer plays randomly half the time, except in the endgame where it plays correctly. It is beatable, and it is the right opponent while you are still learning how the game thinks.

Three stars of difficulty

1-Star Mode is the unadorned game: you, the cats, your wits.

2-Star Mode colours each cat green or red according to whether choosing it leads to a winning or losing move. It is the game with its mathematics revealed in real time, and it is the fastest way to develop intuition for misère Nim.

3-Star Mode shows the complete XOR table for the current and intended positions.

Versus play, in detail

When you start a Versus game, your phone generates a 2D barcode. Your opponent points their phone's camera at the barcode. Their browser opens. They are at the table. The whole exchange takes a few seconds and requires no installation, no login, no friction.

The player who started the session picks who goes first. Both players see the board update in real time as the game proceeds. After the round ends, the organiser can call a rematch, and the game keeps the company together for as long as the evening lasts.

History

Origins

Nim is a classic impartial combinatorial game in which two players alternate removing objects from distinct heaps. Its conceptual origins lie in ancient practices of manipulating counters, though direct evidence for the precise multi-heap form is limited.

In prehistoric times, early humans likely engaged in rudimentary strategic activities using stones, seeds, or bones arranged in piles — for recreation, divination, or decision-making. These represent conceptual precursors to the broader family of pebble-distribution games that later evolved across cultures.

Ancient China

The game is traditionally linked to ancient China, where variants of stone-removal games — sometimes called jiǎn-shízǐ ("picking stones") — are believed to have circulated for many centuries, possibly predating written records.

European Renaissance

European references to Nim-like games appear in the early 16th century. A notable example is found in De Viribus Quantitatis (c. 1508) by Luca Pacioli, which describes a simplified single-pile variant involving removal of numbers up to a fixed limit to reach a target. Similar recreations circulated widely in Renaissance mathematical literature.

The modern theory

The multi-heap version received formal mathematical recognition in 1901, when Harvard mathematician Charles Leonard Bouton published Nim, A Game with a Complete Mathematical Theory. Bouton introduced the Nim-sum — the bitwise XOR of heap sizes — as the key to determining winning and losing positions, and is credited with naming the game, possibly from the German imperative nimm ("take").

The 20th century brought early computing demonstrations, including the Nimatron (1940), an electromechanical device capable of playing perfect Nim, followed by digital implementations on every successive generation of machine.

Marienbad

In 1961, the game gained wider cultural prominence through its appearance in Alain Resnais's avant-garde film L'Année dernière à Marienbad (Last Year at Marienbad). Characters repeatedly play a matchstick variant of Nim — one consistently defeating the other through superior strategy — introducing the game to a much larger audience and giving the misère variant its cinematic name.