🪵 Nim Strategy

About this game

Nim is an ancient mathematical strategy game with a documented history stretching back centuries across multiple cultures, built around a deceptively simple setup of several rows of sticks that hides surprisingly deep game theory beneath the surface. Four rows contain one, three, five, and seven sticks respectively, and on your turn you may remove any number of sticks you like, from just one all the way up to an entire row, but only ever from a single row at a time, never splitting your removal across multiple rows in the same turn. The twist that defines Nim is its misère scoring rule: whoever is forced to take the very last stick on the board actually loses the game, which flips the usual instinct to grab as much as possible on its head and rewards players who understand the hidden binary mathematics governing which positions are winning and which are losing. The computer opponent in this version plays a mathematically optimal strategy based on a concept called the Nim-sum, calculated by combining the row counts using binary exclusive-or arithmetic, meaning that beating it consistently requires genuinely understanding the underlying pattern rather than relying on instinct or luck alone.

02 Related Games