CSCI 107 Assignment 7


Craps Simulation

The purpose of this assignment is to help you gain experience using while loops to solve problems.

For this assignment, you will simulate a simplified game of craps to estimate the percentage of time that the game is won. To play, two six-sided dice are rolled. If they add up to 7 or 11, the game is won. If they add up to 2, 3 or 12, the game is lost. If they add up to any other number, the two dice are repeatedly rolled until either a 7 is rolled (in which case the game is lost) or the original sum is rolled (in which case the game is won).

Example

Sample Output Transcript

This transcript shows two runs of the program. In the first simulation, the program simulates playing craps 100 times. In the second simulation, the program simulates playing craps 1,000,000 times.

The Assignment - 100 points

Requirements and Grading