A classic mathematical duel: take as many tokens as you like from a single row, but only one player can be left holding the last one.
Several rows hold a handful of tokens. Players alternate turns, and on each turn you remove any number of tokens, but all from a single row. The convention you pick decides who wins.
Nim is old and its origins are genuinely unclear. It is often said to have come from China, where it closely resembles jiǎn-shízǐ, 捡石子, "picking stones", but the claim is not settled; the earliest European references date only to the beginning of the 16th century.
The name is younger than the game and was attached to it by mathematics. Charles L. Bouton of Harvard coined it while publishing the complete theory of the game in 1901 — he never fully explained the choice, though the Oxford English Dictionary points at the German nimm, "take".
Bouton's solution made it a landmark. Because the winning strategy can be computed rather than felt, nim became a natural demonstration piece for machines: Westinghouse built the Nimatron to play it at the 1939 New York World's Fair, and over months of exhibition very few visitors beat it.
Nim is an ancient public-domain take-away game and a cornerstone of combinatorial game theory. This is an original, free browser version with a perfect-play AI, hotseat and online modes.