Assignment 2: State-Space Search with Checkers |
CSE 415: Introduction to Artificial Intelligence The University of Washington, Seattle, Winter 2009 |
![]() |
Create a program that plays the game of Checkers.
Your program must implement an interface described below.
This is due Friday, January 30, at noon.
Turn in two files: source code and textual answers.
|
Playing Checkers (100 points)
All of the following functions should be defined in a single file whose name is your UWNetID followed by the extension .py so that each student's program serves as a Python module that can be imported by a tournament control program that holds matches. Implement a function makeMove(state, maxPly, maxTime) that computes three things and returns them in a list of the form [newState, stringComment, stringStats]. The parameters to makeMove have the following significance:
The stringStats string should be a brief report on technical aspects of the search for a good move. It should contain the number of board positions evaluated, the number of alpha cutoffs found, the number of beta cutoffs found, and the number of milliseconds (wall time) that were consumed during the search. |
Implement a function introduce() that returns a string that explains what the full name of the checkers-playing agent is, and some information about who wrote it (name and UWNetID). |
Implement a function nickname() that returns a string representing the short version of the agent's name. |
Implement a function staticValue(board) that takes a board and returns a number representing the static value of that board. If this position is favorable for black, the number should be positive, and if it is favorable for red, the number should be negative. This function should be the same one used to evaluate leaf nodes during the search made by your makeMove function. |
GUI (Optional, for 10 additional points)
Implement a web-based variation of your program that displays a web page with the starting board on it and contains a means for a user to specify a move and to submit the move. The program should respond to each submission by making its move and displaying the new board position, the string comment, and the statistics. The user should be able to carry on an entire game with your program. You may use HTML forms, any GIF images you like, and, if you know Javascript, you may use that to help build the interface. You should deploy your program on the web using the UW student server. Turn in a URL to the page with the rest of your turned in materials. |
Questions and answers.:
Question: What board orientation should we assume for the
board representation given?
Question: How do I indicate that a game is finished?
Question: What does the maxPly parameter mean my program has to do? |
Textual Answers: In a separate file, called A2comments, provide answers to the following questions:
1. What techniques for automatic game playing do you use in your makeMove function? Everyone should include minimax search and alpha-beta pruning, but
also mention any optional techniques you may be using such as Zobrist hashing, iterative deepening, and best-first ordering.
2. What methods do you use to create the string comments that accompany each move? 3. Have you tested your program against anyone else's in the class? If so, whose? What was the outcome? 4. What have you learned in this assignment related to (a) state-space search, (b) game-playing intelligence, (c) programming of AI techniques, (d) other? |
A Test Harness: You may find it useful to put your game into competition as soon as it is able to make moves. To do this, create a folder "test", put your program into it, download runGame.py, holdGame.pyc, and tanimotoCheckers.pyc, and put them in the same test folder. Edit runGame.py so that it imports your own checkers program and either plays itself or plays a classmate's program (you'll need to put a copy of their program for their pyc file in the folder, too, in that case). To test your program, run the runGame.py program. It imports holdGame.pyc which in turn imports tanimotoCheckers.pyc. Note that the file tanimotoCheckers.pyc doesn't play checkers but simply referees the game, helping enforce the rules. If you get errors when trying to test your program, most likely you are not implementing the makeMove, introduce or nickname functions correctly. |
Last updated 21 Jan. with information about the test harness. |