Due: Friday, February 19th, 2010 9:40am
Create a program that acts as a Clue player by communicating with a TCP server at a given host and port number.
The protocol for the game is:
For experimenting, you can use the server provided in server-1.zip. Run a server with n other randomly moving players at port number portno with
mzscheme text-play.ss -p portno -n n
Alternately, run a version with a minimal GUI display using
mred gui-play.ss -p portno -n n
If you run less than 6 players, then the server will wait for additional player clients.
The server will check whether a player's move is legal. If a player cannot move with a give dice roll, it must report back its current location as its move. The server requires a player to choose to roll if not rolling would force it to stay in place while rolling might let it move; similarly the server requires a player to choose not rolling if necessary to move.
The server provided in server-1.zip declares the first player to visit every room to be the winner.
Adjust your client player to try to win the mini game.
When you use text-play.ss or gui-play.ss, you can make some of the players sesinble using the -s flag followed by a number. A sensible automatic player chooses to not roll if that will get it to a new room, and it generally chooses to move into a new room if possible. It doesn't plan ahead by moving near rooms that it hasn't visited, though, so you should be able to beat it often.
Last update: Wednesday, March 5th, 2014mflatt@cs.utah.edu |