Last modified: 2016-10-07
This is a course page of
David Casperson
Associate Professor
Computer Science
University of Northern British Columbia

CPSC 370: Functional and Logic Programming (2006)

A Doubling Nim Program

  • Here is a binary file (executable) for a program written in C++ and compiled on that plays Doubling Nim.
  • The program is a very simple cin/cout that reads pairs of integers representing a position, and then prints the best possible move in that situation.
  • Typical input consists of a pair of integers representing the last two pile sizes, for instance 36 33.
  • Output is typically one integer (4 in the above example) representing the winning move in that position. If there is none, NONE is output.
  • The code is not guaranteed to be bug-free. Thanks to Michael for finding an initial bug.
Home page Semesters Site Map
go back Fall 2006 go forward
2017-09 other links

Semester Map
CPSC 141
CPSC 200
CPSC 370
Course Outline
Handing in Homework
Pending Homework Questions
David’s Schedule