5.92

4 2/3: Universe

Continued on 2/10

Multi-player Checkers

The purpose of this lab is to practice writing distributed programs with Universe.

Exercise 1. Download the skeleton Checkers client and server here:

client

server

Enhance the checker-player% and dragging-player% classes to receive a list of the other player’s pieces. Enhance the to-draw methods to draw those other pieces. Now, both players should be able to see all the pieces. You can launch the worlds by opening the server in one tab and invoking (universe (new init-server%)), then opening the client in another tab and invoking (launch-many-worlds (big-bang (new joining-player%)) (big-bang (new joining-player%))).

Exercise 2. Modify the above program to implement normal moves. The client should send messages to the server only when they would be legitimate...but the server should double-check that they actually are valid.

Exercise 3. Modify the above program to implement single jumps. The client again should send messages to the server only when they would be legitimate, and the server should double-check that they are. Additionally, the server should remove the jumped pieces.

Exercise 4. Modify the above program to enforce that players take turns.

Exercise 5. Modify the above program to enable kings and king moves.

Exercise 6. Modify the above program to enable multiple jumps: a player should hold down the Shift key while dragging a piece from jump to jump. When the player releases the Shift key, the client must send all the jumps to the server at once.