CSPP 51090 & CMSC 22001: Software Construction Assignment 9: Prepare for Tournament

Due: December 7, 2004 @ 5pm

Your task is to get your best player program into shape for the tournament. Each team will only be allowed a single player in the tournament.

The purpose of the tournament is to judge the cleverness of your player and the quality of your code in a practical manner.

The tournament will take place on December 8th, during class. Bring a computer that can get online to run your player or leave your software on a network accessible computer and we can run your player from remotely from my computer.


If you'd like, you can test your protocol implementation against the server that will be used for the tournament. It is provided as a .tar.gz and a .zip file. To use, first install DrScheme (version 208). To start the server, either

  • start up DrScheme, set the language to Graphical (under the PLT tab in the language dialog), open the file main.ss and click the Execute button, or
  • type this at a command-line: mred -qr main.ss. If you put a number at the end of the commandline, it is interpreted as the port number.
In either case, click the Start Tournament button when all of the players have registered.

At most 16 players can be registered. Registrations after that are ignored.


One strategy for building a good player is to generate all possible moves from each position and then pick the board that looks the best, according to some criterion you think up (e. g., pieces are furthest along towards home and/or have a small chance of being bopped).

There is a pitfall to be aware of with this strategy, however. On average, a given board has about 6.6 possible next moves[1], but there are some boards that have thousands of moves. For example, if green rolls double 2s on this board:
<board> <start> <pawn> <color> yellow </color> <id> 3 </id> </pawn> <pawn> <color> yellow </color> <id> 1 </id> </pawn> <pawn> <color> yellow </color> <id> 0 </id> </pawn> <pawn> <color> red </color> <id> 2 </id> </pawn> <pawn> <color> blue </color> <id> 1 </id> </pawn> </start> <main> <piece-loc> <pawn> <color> yellow </color> <id> 2 </id> </pawn> <loc> 63 </loc> </piece-loc> <piece-loc> <pawn> <color> blue </color> <id> 2 </id> </pawn> <loc> 47 </loc> </piece-loc> <piece-loc> <pawn> <color> blue </color> <id> 3 </id> </pawn> <loc> 45 </loc> </piece-loc> <piece-loc> <pawn> <color> green </color> <id> 2 </id> </pawn> <loc> 27 </loc> </piece-loc> <piece-loc> <pawn> <color> red </color> <id> 3 </id> </pawn> <loc> 26 </loc> </piece-loc> <piece-loc> <pawn> <color> red </color> <id> 0 </id> </pawn> <loc> 25 </loc> </piece-loc> <piece-loc> <pawn> <color> red </color> <id> 1 </id> </pawn> <loc> 23 </loc> </piece-loc> <piece-loc> <pawn> <color> green </color> <id> 0 </id> </pawn> <loc> 21 </loc> </piece-loc> <piece-loc> <pawn> <color> blue </color> <id> 0 </id> </pawn> <loc> 17 </loc> </piece-loc> <piece-loc> <pawn> <color> green </color> <id> 3 </id> </pawn> <loc> 5 </loc> </piece-loc> <piece-loc> <pawn> <color> green </color> <id> 1 </id> </pawn> <loc> 5 </loc> </piece-loc> </main> <home-rows> </home-rows> <home> </home> </board>
there are (I believe) 2893 different possible next boards. These boards correspond to legal moves. There may be more than one way to get to the same board (by doing the moves in a different order), but those duplications aren't counted in the 2893. I didn't actually check all 2893 boards manually to be sure they are correct, but here they are, in XML form. Let me know if you find a board in there that doesn't belong or one that isn't there that does belong.

This was the worst board I found. I'm not sure it is the worst (in fact it probably isn't the worst), but I ran more than 50,000 games with four players that pick randomly from the available moves. Overall, I only found about 10 boards that have more than 1500 moves. Since this happens so infrequently, your player implementation can probably get away with just quitting after some fixed number of boards.

[1]: To get this figure, I ran 5000 games with four players that just enumerate all possible moves and pick one randomly (about 915,000 moves over the course of the 5000 games). Your players probably have a different profile, so you might see different averages. For example, I suspect that if you use the MoveLastPawn player from assignment 6 and run the same computation, you'll get a much higher average.



CSPP 51090 & CMSC 22001: Software Construction