Software Construction Assignment 9: Prepare for Tournament

Due: May 23, 2017 @ 5pm. Please include a README.txt that has both partner's names and email addresses.

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 during the final exam period. 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. (Get in touch with me ahead of time and send me some code so I can just make sure basic things work if you want to use this option. You don't have to send the final player, just a version that can at least connect to the server.)

If you'd like, you can test your protocol implementation against the server that will be used for the tournament. It is provided (along with other things) in a .tar.gz and a .zip file. See the README in the bundle for more information.

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.

Software Construction