Second Summer 2006


Homework Six: Developing a Simple Game.
Due date
Thursday July 20, 11:59pm
Late policy
Please turn everything on time, late solutions will not be accepted.

Work policy
Working in groups is encouraged but please turn in your own version of the assignment.

Also, please make sure you

with the Computer Science Department's Statement on Academic Integrity before turning in your assignment.

Task
Create an application that simulates playing the world-famous dice game Craps. In this game, a player rolls two dice. Each die has six faces. Each face contains 1, 2, 3, 4, 5 or 6 spots. After the dice have come to rest, the sum of the spots on the two top faces is calculated. If the sum is 7 or 11 on the first roll, the player wins. If the sum is 2, 3 or 12 on the first roll (called "craps"), the player loses (the "house" wins). If the sum is 4, 5, 6, 8, 9 or 10 on the first roll, that sum becomes the player's "point." To win, a player must continue rolling the dice until the player rolls the point value. The player loses by rolling a 7 before rolling the point. Your program must keep track of and report the number of games won by the user and the number of games won by the computer ("house"). The score should be 0-0 initially and must be updated after each game. The user simply enters the word "roll" every time (s)he wants to proceed. Entering "done" ends the game.

Grading
Feedback will be provided within a week, grades will be posted on-line.