AI Fall 2006 - HW3

Connect-4 Tournament

Due Date: Thursday, 10/26 by 11:59PM

Submit to WebCT drop box labeled HW3

 
           
           
           
       
 

- Assignment

The objectives of this assignment are:

  1. Adversarial Search (Minimax).
  2. Developing a static evaluation function (for Connect-4)

Connect-Four is played on a rectangular grid like the one shown above. Each turn involves dropping a marble (coin, disk, whatever) above any column in the grid (that is not already full) - the marble will drop straight down and end up in the column at the lowest point possible (the lowest row that does not already contain a marble in that column). Each player tries to get four of their marbles in a row (horizontally, vertically or diagonally). If you are not familiar with the game, you should check out some of the many web versions of this game, as well as the description on Wikipedia:

NOTE: The standard game is played on a grid with 6 rows and 7 columns - for our tournament the size of the grid will vary (your code must not make any assumptions about the size of the grid!). The strategy for winning (playing a perfect game) on a standard board size is known, but you cannot assume your agent will be playing on a standard size board!

Your assignment is to create a scheme procedure (function) that will determine the best move to be made given the current state of the game and the player whose turn it is. The return value must be a single integer indicating a column number. The number of rows and columns in the current game can be derived from the size of the state representation given your function, you cannot make any assumptions about the size of the game grid.

Your procedure will participate in a tournament to determine the best ConnectFour procedure in the class. The winner will receive a great grade, a sprinkling of fame, and perhaps a cookie. Tournament results will be available on the WWW and will be updated daily. The semifinals and finals will be played out in front of a live audience (that is, during class).


IMPORTANT
All Your Procedures must start with your RCS user name
The Procedure that will be called (by the tournament software) is <rcsid>-getmove.

Since your code will be participating in an automated tournament, both your code and your opponents will be running in the same scheme environment. We need to make sure that you don't have a top level procedure that is the same name as a procedure your opponent has written. Here are the rules:

Sample Code (MIT Scheme)
Some sample code is here. This code includes:

Note: You should not make any assumptions about the tournament environment, if could involve completely different code than is provided in the sample code. If you want to use some of the procedures defined in the sample code, you must include them (and they need to be named with your rcsid).

- Grading

Your grade depends on the following formula:

Note that how well your code does depends on two factors: