Skip to content

derbedhruv/nimgame1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Nim Game solved by Minimax algorithm

Author: Dhruv Joshi

This is a very simple application of the minimax algorithm to play an adversarial zero-sum game against the computer. It is based on concepts learned when I took the class CS221 (Artificial Intelligence) taught by Prof. Percy Liang at Stanford.

Objective of the game

The last player to move the "rock" into the end position wins the game. This can be modelled as a subtraction game - assume we start with a number 25 and either player can subtract 1,2 or 3. Turn by turn, each player chooses how much to subtract. The person to subtract the last number and reach 0 wins.

References

About

Simple 2-player nim game (subtraction game) using minmax algorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published