Mathematics & Computer Science
The game board will be an 8 by 8 grid (a standard chess board) with no significant color distinctions among the 64 squares. (You may add color variation for esthetic reasons, but they are not required.) Each player will be given 6 markers (of a color that is unique to the player). The markers will be initially lined up on one edge (excluding the corner squares). The goal is to move all 6 markers to the opposite edge. Only single horizontal or vertical moves are allowed. It is permissible to move backwards, but you cannot move into an occupied square. You may assume that jumps and diagonal moves are not allowed.
It should be possible for other people to register with the server as observers. The server should send them details of the game as it progresses, but observers will not interact with the game in any other way. (This detail should not be implemented until the two player game is working properly.)
When a game terminates, the client must clearly indicate this and clear up any game artifacts. However, the application (or applet) must not terminate. The player should have the option of re-connecting the game server for more service.
The first image shows a sample control window. The player (Xue Bao-chai) has entered her name, chosen a two-player game and then connected to the game server. Since Lin Dai-yu contacted the server first and requested a three-player game, the server ignored the two-player request and added Miss Xue as the third player.
The next image shows a game that is in progress. It is currently Miss Lin's turn. She has placed the mouse on the marker she wishes to move. That square has been painted red. As she drags the mouse to another square, the new square will become red. If she releases the mouse button over a legal square, her marker will be moved. The server will also update the game boards for the other players.
The control window displays messages from the server, including a reminder of whose turn it is, the successful completion of a game, and error messages. The image shows several messages related to Master Bao's attempts to cheat. The server would also notify him if he attempts to move when it is not his turn.
The system should be robust. This is partially related to the refusal to let a player cheat. Even more, the server should gracefully handle other non-standard events. For example, it is very likely that part way through the game, Lin Dai-yu will burst into tears and prematurely shut down her game client. The next time the server sends an update message over the socket that used to be connected to her client, a socket error will occur. The server should not crash. One possible action would be to gracefully terminate the game on the remaining clients and let Jia Bao-yu and Xue Bao-chai re-connect for a two-person game.