Nim Game: A game of logic and strategy with matches: History, science, and user guide
This document covers the history, science, and user guide for the Nim Game, version 2.0, a free computer version of Nim, in which the player and the computer take turns removing matches from rows of 1, 3, 5, and 7, as many as they like but from one row only, and the player who takes the last match loses. Version 2.0 rewrites the game in plain HTML, CSS, and JavaScript, delivered as a web page, an installable web app, and a desktop program, and adds a second rule (last match wins), four more boards (3-4-5, 2-4-6-8, 1-2-3-4-5, and random rows), a Perfect and a Learner computer, Undo, Hint, and Show the math. The first chapter traces Nim from its mathematical theory by Bouton in 1901, through the Nimatron of the 1940 New York World's Fair, the Nimrod computer of the 1951 Festival of Britain, and the film Last Year at Marienbad, to the teacher who taught the author the game, the web page of 2010, the desktop program of 2012 to 2025, and version 2.0. The second chapter explains the mathematics: won and lost positions, the rows in binary, the nim-sum, the change made by the misère rule, how the computer plays and how to beat it, a worked game, and the Sprague-Grundy theory; on the classic board, 48 of the 383 positions are lost, the starting position among them, so the player who moves first cannot win against perfect play. The third chapter is a quick guide to playing the game.
Authors
- Luis Orlindo Tedeschi (ORCID: https://orcid.org/0000-0003-1883-4911)
Institutions
- Texas A&M University (US)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-02
- DOI
- https://doi.org/10.5281/zenodo.24749515
- Primary Topic
- Artificial Intelligence in Games
- Type
- article
- Field-Weighted Citation Impact
- 0.00