You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nim is a game played by two people, who take turns selecting tokens from a board. The player who picks up the last token wins.
This implementation was written as an exercise while learning Clojure.
## Usage
In a repl:
(use '[nim.ctl] :reload)
(start-game) ;Initializes board to default preferences.
(take-tokens number-of-tokens) ;Player takes a turn by taking number-of-tokens
(machine-takes-turn) ;The application makes a choice for the current turn.
Note: machine-takes-turn does an exhaustive look-ahead, evaluating all possible moves. So it selects the next move that maximizes the ratio of winning end conditions over all possible end conditions.
## License
Copyright (c) 2011 Jim Tyhurst
Distributed under the Eclipse Public License, the same as Clojure.