CSE 150 Programming Assignment #3
Date assigned: May 12, 2007
Date due: 11:59:59 May 24, 2007
In this programming assignment, you will be asked to construct a program to play Checkers.
Logistics:
You can work alone or in groups of at most 3. Code must be submitted (with comments) by the due date. Use of Java for this assignment is required. A copy of your write up as a pdf should be included. Turn in the code using the turnin script.
Hard copies of write-ups are due at the beginning of class the following class, printed and stapled. Code should be included in the printout. Write-ups should include a brief description of the approach taken, answers to any questions posed, and sample output on some examples. See below for more details on the content of the write up.
Half of the points are based on the quality of the write-up, testing, and code. The other half are based on the performance of your code on a test set of problems and against other student’s submissions. Bonus points may be awarded at the TA's discretion for going above and beyond the HW's description.
Points will be deducted for not following these instructions. Note that no late programming assignments will be accepted!
Code:
In order to allow programs to compete against each other, we are providing some common code to manage game play. Essentially, your program will be given a board state and must return the move your program decides to take. Code is available here. Javadoc documentation is available here. Supplied code is currently beta. If updates occur, a notification will go out on the discussion board. If you find a bug, please report it to the TA.
Our Game class handles the generation of possible moves, and keeps track of the depth and number of expansions. For various parts of the assignment, you will either be limited by depth or by the number of total board states you’ve expanded. Some attempt has been made to enforce the required interface, but it may be possible to circumvent this; ANY CODE THAT BYPASSES THE REQUIRED INTERFACE WILL BE HEAVILY PENALIZED. If you have a question whether something is legal, ask.
Board: This class contains the basic state information, namely:
It also contains some additional functionality for move primitives, which you are not to use.
Solver: An interface that your classes must implement. It requires you to implement a method chooseMove.
Player: Sample code for game play. You’ll need to modify this (or create your own) to test your code.
RandomPlayer: A sample Solver that chooses moves at random. Used as a template, and to give you something to compare your methods against.
BoardManipulator: This class manipulates a Board to generate the possible successor states. It is used extensively by the Game class, but is NOT to be used directly by your program.
Game: This manages the game and the search functionality, providing all necessary functions and information not provided by the Board class. Namely:
Expansion returns a Vector of Boards. Since moves can be of near arbitrary length (for multiple jumps), actions themselves are simply an index into this Vector.
Essentially your program receives a Board and must return an integer representing an action which is an index into the Vector of Board states. Each solver you construct must implement the Solver interface and have a constructor taking no arguments.
You must do
SOMETHING that makes your best algorithm do better than vanilla alpha-beta
pruning with the sum-of-board evaluation. Beam search may be a good place to
start, given the lack of limits on the number of evaluations.
The competitive
solvers will compete against each other. This will be run in “look-limited”
mode, where you can only expand up to a set number of game states each move.
The exact limit will not necessarily be announced ahead of time, but will be at
least 500 nodes. In addition to the points awarded to the winner, there may be
an additional prize.
Write up:
Please describe the approach taken and how your program should be executed. What kind of testing did you do, and how did your methods fare? How deeply could you search? Qualitatively, how well does your program seem to play?
You should include a graph of the average time per move as a function of max depth for your three methods.
As described in the last assignment, the following is a good outline. Please use it.
1. Files submitted (with brief description of each)
2. How to run (including unpacking, compiling)
3. Approach (describe algorithm(s)), problems encountered, hurdles overcome)
4. Known bugs (hopefully empty! But better to report than for me to find.)
5. Extra credit (can be empty - just because it's here doesn't mean you'll get points, but won't get points if not listed)
6. Sample output (since you’re only returning a number, this should be output from your testing)
7. Testing (convince me (and yourself) it works! Be thorough.)
8. Answers to questions
9. Summary
Testing:
Most testing will be running your code against itself (or against a different algorithm). Be sure to show that your “best” algorithm can outperform vanilla alpha-beta pruning most of the time. You may want to introduce an interface so that you can play against it.
Grading:
As described, half your points will be based on the report you turn in and half on evaluation. Minimax, alpha-beta pruning, and an improved version are all worth ten points of evaluation, while the remaining 20 points will be based on how your improved version does in the competition.