CIS 479 Assignment 2
Summer 2008

     For your second assignment, create a computer opponent that uses mini-max with alpha-beta pruning to play the Euclid’s game with a human opponent. You will need to write a program for your task and implement it in some programming language (Lisp, C++, Pascal, Prolog, etc.). You may work with a partner, if you wish. However, each partner will need to submit a separate written report.

     You may use the Lisp code on the CIS 479 web page as the basis of your mini-max algorithm, or the demonstration programs (Pascal or C++) on the CIS 479 web page. You will need to devise experiments to demonstrate that your algorithm with alpha-beta pruning does indeed output perform ordinary min-max.

     In Euclid’s game, players take turns writing the positive difference of any two numbers displayed. Each player’s choice is added to the display. Play continues until one player cannot write a difference that is not already displayed. An example of as complete game appears below. You program should handle pairs of initial numbers up to 18.

          Start:                 3          7

          Human:            4

          AI:                     1

          Human:            6

          AI:                     5

         Human:             2

         In this case, there are no more possible numbers and human wins (if we started 9 and 3 game would end after one round when a player uses 6).

     You will need to turn in a well-commented program listing, sample runs (with neatly organized output), and a memo discussing your solution. In your memo, you should describe what makes your algorithm "smart" (ie. from what knowledge source does it derive its power). You need to turn in the output from your experiments showing that the alpha-beta cutoffs are occurring. You need to discuss the results of your experiments and determine the work saved by alpha-beta pruning. To help you determine how much work your algorithm is doing, you may wish to display some of your internal data structures during program execution.

Assigned: 5-14-08
Date due: 6-02-08