Software Construction Assignment 2: Silly Game |
Due: April 12, 2018 @ 10pm. Please include a README.txt that has both partners' names and email addresses. |
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 new version of the rules that guarantees that a game never lasts forever. 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 for the main course project. The goal of the project is to implement and maintain Tsuro. Eventually we will run the game via a server into which independent programmers can plug in automated players and we will conduct a tournament during our final exam slot. Write the one-page "story" for the project. The story must identify the major components (concepts) of the game and how they interact (use cases). Include interface definitions for these components (in your programming language, or as comments if your language doesn't support such interfaces directly). Develop a simple algorithmic strategy for playing Tsuro automatically -- do not implement it, just think through the rules to figure out what would constitute a simple player that does not cheat. Describe your strategy as part of the story. If you want to play a few games of Tsuro, use my implementation, available as tsuro.tar.gz or tsuro.zip. The README file explains how to play. Hand in this assignment via canvas. |
Software Construction |