Board games

Nim

Take marks from a single row each turn and avoid being left to take the last one.

Loading Nim...

Every game plays locally in your browser. Nothing about your play is uploaded to a server. Your high scores are kept in this browser on this device only, and you can clear anything these games have saved from the privacy page.

Controls

Up and Down arrowsChoose which row to take from.
Left and Right arrowsSet how many marks to take.
Space, Enter or tapTake the chosen marks.
RStart a new game.

How to play

  1. Press R or tap to start. You move first against the computer.
  2. Choose a row with the up and down arrows, then set how many marks to take with the left and right arrows.
  3. Press space, Enter, or tap to take that many marks from the chosen row. You must take at least one.
  4. Whoever is forced to take the very last mark loses, so plan to leave your opponent holding it.

About Nim

Nim is the game that looks like nothing and turns out to be solved mathematics. There are a few rows of marks; on your turn you take as many as you like from a single row, and whoever is forced to take the last mark loses. It sounds like a toss-up, yet there is a precise winning strategy hiding in the binary of the row counts.

That strategy is unforgiving: from a winning position perfect play never slips, so the opening matters. This version deals you a start that can be won and lets you move first, which means a careful player can beat the computer every time - and the moment you hand it an even position, it will punish the mistake. You pick a row, choose how many to take, and confirm with the primary key or a tap.

Frequently asked questions

You are dealt a starting position that can be won and you move first, so with perfect play you can win every game. Hand the computer an even position, though, and it will punish the slip.

Taking the very last mark loses. The whole game is about forcing your opponent to be the one who must take it.

While you are here

BNS Data Tools

The same team builds a set of free, privacy-first data and developer utilities - formatters, converters, validators and calculators - that run in your browser the same way these games do.

Open BNS Data Tools