IMGD 4000 (D 08)
Individual Homework Assignment #3
Due by Web Turn-In: Midnight, Sunday, March 30
(See general homework instructions for turn-in details.)
The goal of this third assignment in the sequence of five is to add an AI opponent to your chess game. "Shallow Blue" is a pun on Deep Blue, the IBM computer chess system which beat the reigning world champion in 1997.
NB: The next assignment will involve moving the AI portion of your system to a server. So think ahead about this modularity when you design your code!
Please post any questions to the myWPI discussion board for the course.
- All the technical requirements of Assignment #2 (Legal Chess) with respect to legal moves, removal of captured pieces, detection of check and checkmate, etc., shall apply.
Note: If your Assignment #2 was substantially incomplete and you feel you cannot catch up, contact the instructor as soon as possible regarding the possibility of obtaining another student's version of Assignment #2 as a starting point for this assignment.
- You shall use the NegaMax with Alpha-Beta Pruning algorithm discussed in class and in Millington, Section 8.2.
Hint: For information about static evaluation functions in chess see articles at gamedev.net and GNU.
Hint: To avoid the AI playing exactly the same game over and over (b-o-o-oring!), consider introducing the Collections.shuffle() method at appropriate points, e.g., before searching the next moves at a given level, so that a different tied evaluation is chosen. This will also be useful when you have different AI's play against each other. Make sure you use a random seed, so that play is reproducible for debugging purposes.
- You shall provide the following control parameters in your game code, which are settable as a space-separated list from the command line args, in the order listed below. (These will facilitate using this code in our end-of-course tournament!)
Hint: Use Integer.parseInt for integer parameters and Boolean.valueOf for boolean parameters.
- auto (boolean) - if true, then AI plays both white and black; otherwise AI and human play in alternation.
- headless (boolean) - if true and auto is true, then graphics is totally skipped; otherwise rendering is normal.
- white (boolean) - if true, then AI plays white (goes first); otherwise human plays white. This parameter is ignored if auto is true.
- maxDepth (int) - the maximum depth (number of plies) of the game search.
- difficulty (String) - values "beginner", "intermediate" and "advanced" appropriately adjust the static evaluation function.
- Provide a game recording facility using
standard chess notation to produce a human-readable record of each game played. The record shall include the depth of search (plies) for the AI moves, and the determination of check and of checkmate.
- Include in your README.txt file the record of two complete games that actually ran in your implementation: one in which the human wins and one in which the computer wins.
- Add special code for predefined chess openings