CSPP 51090 & CMSC 22001: Software Construction Assignment 3: Parcheesi Rules |
Due: October 19, 2004 @ 5pm |
Your task is to implement Parcheesi rules checker and the basic infrastructure for playing the game. The program provides an administrator and a player. The administrator manages the board, the remaining tiles, and the game itself. Each player registers with the administrator. Once the game is started, the administrator gives each of the players one turn per round. Note that this assignment does not require you to implement any players, except possibly to test your administrator. Here is a starting point for your design. interface Player { // inform the player that a game has started // and what color the player is. void startGame(String color); // construct the player's moves Move[] doMove(Board brd, int[] dice) // inform the player that they have suffered // a doubles penalty void DoublesPenalty(); } interface Game { // add a player to the game void register(Player p); // start a game void start(); } interface Move {} // represents a move where a player enters a piece class EnterPiece implements Move { Pawn pawn; EnterPiece(Pawn pawn) { this.pawn=pawn; } } // represents a move that starts on the main ring // (but does not have to end up there) class MoveMain implements Move { Pawn pawn; int start; int distance; MoveMain(Pawn pawn, int start, int distance) { this.pawn=pawn; this.start=start; this.distance=distance; } } // represents a move that starts on one of the home rows class MoveHome implements Move { Pawn pawn; int start; int distance; MoveHome(Pawn pawn, int start, int distance) { this.pawn=pawn; this.start=start; this.distance=distance; } } class Pawn { int /* 0-3 */ id; String color; Pawn (int id, String color) { this.id=id; this.color=color; } }Whether you use Java or not, you must structure your program as these interfaces and classes suggest. In Java, you must use these interfaces and classes. The administrator must detect if a player cheats, according to the rules of Parcheesi. Organization hint One organization for this assignment is to build these two helper functions.
|
CSPP 51090 & CMSC 22001: Software Construction |