CS347 SP2005 Chess: Phase I - Random Search
Revision 1/12/2005. Note: it is the students' responsibility
to check the CS347 website for possible new revisions!
Assignment
Chess is a two-person zero-sum game well-known to most of you (if not,
search the web and you will find more than you ever wanted to know
about chess! For all kinds of information on programming chess, see the
GTA's collection of links at http://web.umr.edu/~cs347a/sp2005/chess/.
For the chess assignments we'll be using the XBoard/WinBoard for the
GUI and a simplified version of Cassandre as a base for our programs.
You can download the simplified version of Cassandre for either Windows
(WinCassandre.zip)
or Unix (UnixCassandre.tar.gz).
Cassandre utilizes a Engine class to encapsulate the chess engine. The
play() function in Engine.cpp is where plays are actually made.
Cassandre also implements the popular "bitboard" representation for the
chess board. Be sure to take a look through the bitboard references at
the bottom of the chess page (http://web.umr.edu/~cs347a/sp2005/chess/).
In this first phase all you have to do is fill in the play
function in the provided framework to attempt to solve the puzzle using Random Search, one move at a time.
Note: this is an individual project; plagiarism of any type will result in a zero grade.
You need to submit any changes that you make for files that you add.
If you submit more than one file, please zip them into a single file.
For this particular assignment, you may just change the Engine.cpp
file, however you're free to change other files as well. Be sure to
document any changes that you make and list which extra credit problems
you've completed (if any).
Grading
The maximum number of points you can get is 30 (and 30 bonus), the
minimal is 0. The following are the maximum number of points per
component:
- Random move generation: 10
- Good programming practices (style, comments, modular design, etc.): 10
- Code reliability (no crashes, defensive programming, compiles correctly): 10
- Bonus Points:
- (2 points) Modify the interface class to also allow debugging messages to XBoard.
The easiest way to do this is to simply add a function that will do a cout << "telluser " << message << endl;.
See XBoard protocol documentation for info. about telluser and other useful messages.
(You aren't restricted to "telluser" - use whichever message will work best)
- (2 points) Update your play function and Interface.cpp (where it
calls play). Currently it only returns "moves", but it should also be
capable of returning a loss, also called a RESULT message.
See the "RESULT" portion of the XBoard protocol; you'll need to
determine which player you are (based on currentPosition) and
do a cout like: cout << "0-1 {Black Mates}" << endl; or cout << "1-0 {White Mates}" << endl;, etc.
Be sure that this will work correctly when you're playing either color.
- (2 points) You may also add in a function(s) to determine if there is a draw and actually call the draw.
Remember that just because a draw exists, calling it may or may not be advantagous.
- (10 points) Generic "CheckWin" function that will check to
see if either player wins. At a bear minimum you must check for
checkmates, but a few additional points will be given if you also check
for other win conditions. (Note: This will certainly be required
for future work. You might as well do it now and get some extra credit)
Again, be sure that this will work correctly when you are playing either color.
- (14 points) If you can find and correct flaws in Cassandre's move generator, additional bonus points will be given.
(Fix either moves that are legal but not being generated or moves that are being generated but are illegal)
If you do all the bonus parts, you should have a player that makes
random moves and detects wins, an interface to help you debug,
and, most importantly, you'll have a better understanding of the basic
parts of Cassandre.
Multiple Submissions and Late Submissions
While it is hoped that all code will be submitted error-free and on
time, this may not always be the case, so the following rules apply if
code is not submitted error-free or on time:
- You must make your final submission within 48 hours of the
due date. Submissions which are more than two days late will not
be graded.
- If your code is submitted late, a 10 point per day penalty will
apply (fractions of days are rounded up), after two days you will
automatically receive a zero.
- Resubmissions are allowed but late penalties will apply based on
the last submission.