Nim

I built a version of Nim, a mathematical strategy game where players take turns removing items from three distinct piles. Players can remove as many items from one single pile during a turn. The player who is left to remove the last remaining piece loses, under the 'misere' style of game-play. It's a simple game to play, but involves some interesting math to calculate the optimal move on each turn.

After building the two-player version, I implemented a computer player that is able to beat a human player under the 'misere' style of playing conditions. I build the computer logic for playing the game based on the proven combinatorial game theory for Nim, which you can read about here.


Front End:

JavaScript

HTML

CSS

Materialize

nim homepage
nim responsive