Program 4: Game Playing

Due Date

This assignment is due at the beginning of class on Monday, December 8th. This assignment may not be handed in late. During the class period on Monday, December 8th we will meet in EPS 254 and conduct a tournament.


You may work with at most one other person on this assignment. If you work with a partner, please submit just one solution with both of your names on it.


The purpose of this assignment is to give you experience with AI game playing techniques. It will also help reinforce your Common Lisp coding skills.

Driver Program

A driver program has been provided for you in the file p4.lsp. Notice that the white-get-move and black-get-move functions (and any other supporting functions) will ultimately need to be implemented by you. Both of these functions should return an answer in the form '((a b)(c d)). (a b) are the coordinates of the stone to move. (c d) are the row and column increments for the direction in which the stone is going to move. Legal values for both c and d are -1, 0 or 1.

White Program

Provide an implementation for the white player in a file named "white.l". Prefix all functions in this file with "white-".

Black Program

Provide an implementation for the black player in a second file named "black.l". Prefix all functions in this file with "black-".

Tournament Logistics

The tournament will be a double elimination tournament. You will play each opponent once as "white" and once as "black". Before playing a game, load the "white" file first, the "black" file second, and the "driver" file third. (A compiled version of the "driver" file will be provided for the tournament.)

The winner will be determined using the following criteria:

  1. The first program to make an illegal move automatically loses the current game.
  2. On the day of the tournament, your program must be able to select its next move using 2 seconds of CPU time or less. If your program takes much longer for any given move, the program loses the game.
  3. If the game is not finished after 100 total moves are made, the game will be considered to have ended in a tie.
  4. Report the results (win, loss, tie) from both games to John. In the event of a tie (each program wins once and loses once or the programs tie both games), a coin toss will determine the winner and loser.

What to Submit


Valid XHTML 1.0!