Nim

Nim is a free token-taking game you can play in your browser. Remove any number from a single pile against Easy, Medium, or Hard. Play Classic 3-4-5, a random deal, or the shared daily piles, in normal play or Misère.

Also known as: nim game, subtraction game, takeaway piles

Play Nim free in your browser. Remove tokens from one pile at a time against Easy, Medium, or Hard. Classic, random, or a shared daily deal, with normal or Misère rules.

How to play Nim

  1. Choose Classic, Random, or Daily, then Easy, Medium, or Hard. Classic is piles of 3, 4, and 5. Random deals 3–5 piles. Daily uses the UTC date, so every device gets the same piles and the same first player until midnight. Open Daily from a link with ?daily=1. Who starts (You or Computer) is saved for Classic and Random. Daily locks that control to the day’s deal. Difficulty stays selectable on Daily.
  2. On your turn, tap a token to preview removing it and every token to its right. Tap that same token again, or Confirm, to play. Tap outside the piles to clear the preview. You may take from only one pile. An emptied pile stays in place so the pile numbers do not move.
  3. The computer waits a moment, then replies. Easy takes a random legal number. Medium plays a winning move about 70% of the time. Hard plays a winning move whenever one exists.
  4. Normal play: whoever takes the last token wins. Misère is the gear toggle, saved on this device: whoever takes the last token loses. Flipping Misère during a game restarts that same deal under the new rules.
  5. Undo puts the piles back to the start of your turn, including the computer’s reply. It is off while the computer is thinking and until you have moved. Hint highlights one winning cut. If none exists, the status line says so. How to play scrolls to these steps.

A finished game is a win or a loss. The result counts your takes and how many hints you used. Stats stay on this device: wins and losses by difficulty and rules (Easy Normal, Hard Misère, and the rest). Daily games use the difficulty you played. A win adds to the current streak; a loss resets it. The longest streak is kept. Daily best is the fewest takes among your wins for that UTC date, stored separately for Normal and Misère.

All games — Timer Challenge, Ball Race, Memory Grid, Split in Half, Crack the Password, Guess Number Up/Down, Hidden Bottle Order, Ball Color Sorting, Color Order, Color Match, Missing Object, Perfect 10s, 2048, Brick Breaker, Asteroids, Block Drop, Sky Hop, Snake, Minesweeper, Lights Out, Golf Solitaire, Pyramid Solitaire, Tri Peaks, Nonogram, Simon, Flood Fill, Sliding Puzzle, Sudoku, Speed Type, Whack-a-Mole, Spatial Maze, Connect Four, Tower of Hanoi, Tic-Tac-Toe, Mastermind, Color Tap, Yacht Dice, Connect Dots, Match Pairs, KenKen, Tower Stack, Pipe Flow, Rush Hour, Sokoban, Reversi, Pinball, Steal the Pile, Color Cards, Dots and Boxes, Make 24, Grid Wars, Crazy Eights, Blackjack, Mancala, Farkle, Hashi