PVS Nim icon

Description

Nim is a classical game of logic and strategy characterized by simple rules but rich mathematical structure. In its most common form, the game consists of several rows (or piles) of objects—traditionally matches or stones. Two players take turns removing one or more objects from a single row during each move. The defining rule of the version implemented here is misère Nim: the player who removes the last object loses the game. Despite its apparent simplicity, Nim requires careful planning and foresight, as each move alters the strategic landscape for both players.

The origins of Nim can be traced back to the late 19th century, although similar take-away games existed much earlier in various cultures. The game was formally analyzed and popularized by the mathematician Charles L. Bouton in 1901, who demonstrated that Nim is completely solvable using mathematical principles. Bouton showed that every position in the game can be classified as either winning or losing, and that optimal play can be determined through a simple calculation involving binary representations of the pile sizes. This discovery made Nim one of the earliest games to be fully understood from a mathematical standpoint.

Over time, Nim has inspired numerous variations that modify its rules and complexity. These variations may change the win condition (for example, making the player who takes the last object the winner), restrict the maximum number of objects that can be removed in a turn, alter the number of rows, or vary the initial distribution of objects. Each modification changes the strategic dynamics of the game, sometimes subtly and sometimes dramatically, making Nim a flexible framework for exploring game theory, combinatorics, and decision-making.

Manual

The Nim Game manual is a PDF file available in English.

Top Top

Download

Desktop program made with Tauri

Tauri

HTML Executable

HTML Executable

webview2 logo

WebView2

Windows 11 compatible

chip

64 bit

Version 2.0 of the Nim Game is written in plain web technologies (HTML, CSS, and JavaScript), so the same game runs in a browser and on the desktop. It adds a choice of rules (the last match loses, or wins), several boards, a computer that plays perfectly or makes mistakes, Undo, Hint, and Show the math, which displays the rows in binary with their nim-sum and tells whether the position is won or lost. Players can interactively explore strategic principles within a finite yet nontrivial game space, experiment with different approaches, and learn to recognize winning and losing positions.

Current version of the Nim Game is Loading...

Download for Windows

The program is for Windows 10 and 11 (64 bit). The same game is compiled using two different platforms, Tauri and HTML Executable; both can be installed on the same computer, and each keeps its own score. They show the game with Microsoft Edge WebView2, which is already part of nearly all of these computers; where it is missing, the setup installs it.

Play online

No installation is needed, and it works on any computer, tablet, or phone with a current browser. In Microsoft Edge or Google Chrome, the game can also be installed from the browser (the Install icon in the address bar): it then opens in its own window and plays offline.

Previous versions can be downloaded from here.

Top Top

Registration

No registration is needed for the current version. Nonetheless, you are welcome to submit your comments to improve this app at the Contact us web page.

Top Top

Developers


Dr. Luis O. Tedeschi

Dr. Luis O. Tedeschi
Professor
Texas A&M University
Department of Animal Science
230 Kleberg Center
2471 TAMU
College Station, TX 77843-2471
US

Texas A&M University Logo

Top Top

Support

The following list summarizes corrections, enhancements, and functional improvements made to the software, presented in chronological order (newest to oldest). Each entry reflects updates implemented to improve stability, usability, and overall performance.

There are no corrections, enhancements, or functional improvements to report at this time. However, several related documents, manuscripts, and reports are listed on the Publications web page.

Top Top

This section will be updated with relevant links as they are identified and curated for this app.

Top Top