CMSC 22001: Software Construction Assignment 2: Silly Game

Due: Jan 19, 2006 @ noon

Your task is to modify a program that comes with comments and test suites. The program implements a silly game: 21. The N players meet at a table and roll a dice. Every player rolls the dice once per round. They add up their scores. A player can skip his turn or declare that he is done. A player is eliminated if/when his score surpasses 21.

End of game: The game is over when all players are eliminated or done.

Scoring: The winners are those players with the maximum score.

The given program allows players to roll the die, to skip a turn, or to declare that they are done. It implements both an automated machine player and an interface to a human player.

Problem 1: With the given program, a game may last forever. Design and implement a strategy that guarantees that a game ends. Don't forget to modify the documentation and the test suites.

Problem 2: Modify the given program so that a player can roll the die twice per turn. Don't forget to modify the documentation and the test suites.


Your second task is to prepare the term project. The goal of the project is to implement and maintain Carcassonne. Eventually we will run the game via a server into which independent programmers can plug in automated players.

Develop a simple algorithmic strategy for playing Carcassonne automatically -- do not implement it, just figure out what would constitute a simple player that does not cheat. Thinking thru this will help prepare you for future assignments.



CMSC 22001: Software Construction