Home / Board / #073

Nim Sticks

The ancient take-away game: remove sticks from one row per turn - take the last (or avoid it in misere).

Board Emulator verified v1.0.0 17.2 KB

The JAR and JAD are the Original Java ME Version for phones and emulators. How to install.

About

Rows of matchsticks, two players, one rule: take any number of sticks from a single row. Normal play rewards taking the final stick; misere play punishes it. The standard CPU blunders now and then, while the Expert CPU plays the mathematically perfect nim-sum strategy - you can still win, but only from a winning position and without a single slip. Boards are the classic 1-3-5-7 or randomly dealt.

Objective: Normal: take the last stick. Misere: force the CPU to take it.

Modes: Normal vs CPU, Misere vs CPU, Normal vs Expert, Misere vs Expert

board game math strategy nim

Nim Sticks title screen
Title screen
Nim Sticks gameplay
Gameplay
Nim Sticks running in MicroEmulator
In MicroEmulator 2.0.4

Screenshots captured from the real JAR at 176x208 on the project's reference runtime; the third image is rendered by MicroEmulator 2.0.4.

Controls

KeyAction
2/8Choose row
4/6Choose how many
5Take sticks
*Pause menu

In every game: 5 selects in menus, * pauses, and on the title screen # opens help and 0 toggles sound. The joystick and 2/4/6/8 are interchangeable.

Verification

LevelStatusDetails
Build verifiedYesCompiled against CLDC 1.0 / MIDP 2.0; JAR + JAD generated
Reference runtimeYesPassed at 128x128, 128x160, 176x208, 176x220, 240x320
Emulator verifiedYesAutomated smoke test on MicroEmulator 2.0.4 (176x220)
Real device verifiedNoNot yet tested on real hardware

Tried it on a real phone? Send a device report.

Technical details

MIDletnimsticks.NimSticksMIDlet
PlatformJava ME, CLDC 1.0, MIDP 2.0
JAR size17.2 KB
Screens128x128, 128x160, 176x208, 176x220, 240x320
StorageRMS record store gk (settings, best score)