Homework 1: Game Playing

Connect-Four (due Oct 4, 2000)

Develop a program that plays connect-four. The game is played on an infinite grid. The players (``X'' and ``O'') take turns placing their pieces on the grid, with ``X'' always going first. The pieces are ``dropped'' into place from the top, so that pieces become stacked on top of each other as in the example below. The player that gets four of his/her/its pieces in a row (or column or diagonal) wins. A possible final state of the game in which player 2 has won is:

              
           
       XO  
    O OOX  
   OX XOXO 
  XOO XOXX 
  XOO OXOO 
  OXX XOOX 
  XXO XOXX 
  OXO XXXO 
  XOX OOOX 
  1. Implement the state representation and your heuristic functions so that they work on an infinite grid (the first piece establishes the origin for the grid coordinates).
  2. Implement minimax search with alpha-beta pruning (you can use /u/cs381k/alphabeta.lsp as a starting point).
  3. Make the search iterative-deepening with a time bound (i.e. the program aborts the search before the time limit is exceeded and returns the current best move).
  4. Write your program so that it can play against the user or other programs (or itself; i.e., you should be able to run (compete ``xxx'' ``xxx'') where ``xxx'' is your name). We'll play a tournament, and the top programs win valuable prizes!! (like extra points for their creator). The format of the user interface is described in /u/risto/public/cs381k/hw1/interface-specs.ps , and the source code for the crucial parts is in /u/risto/public/cs381k/hw1/interface.lsp .
  5. (Extra points) Implement a few ``book moves'', such as traps and ways to avoid them, and recognizing obvious winning situations. You could also implement techniques to get around the horizon effect.

Your program should be able to display the state of the game after each move, and also explain what strategies, book moves, etc. it is considering. Turn in some log output explaining how the program works, but turn off logging routine calls when you turn in your program for the tournament.

IMPORTANT: Submit a well-written report describing how the program works, what you learned about game playing, what the major problems are for your program, and what ideas you have on how to make it play better.


risto@cs.utexas.edu
Wed Aug 30 01:18:09 2000