### Craps (Due 24 Feb 2017)

In this assignment you will calculate the probability of winning at Craps in a casino with a pair of fair dice. Here are the rules for Craps.

• Players play against the house and not against each other.
• This is a pure probabilistic game with no strategy involved.
• A player takes turns at rolling two dice.
• A game is played in rounds consisting of two phases: come out and point. The outcome of a round is either the player wins or loses.
• To start a round, the player makes a come out roll with two dice.
• In the come out roll, if the total of the two dice is 7 or 11, the player wins.
• In the come out roll, if the total of the two dice is 2, 3, or 12, the player loses.
• If the come out roll, if the total of two dice is 4, 5, 6, 8, 9, or 10, then that is the point for the player and the point phase begins
• In the point phase the goal for the player is to roll the same point value before rolling a 7.
• In the point phase if a player rolls a 7 before the point value, he loses.
• In the point phase, if the player rolls the same point value, before a 7, then he wins.

You will simulate the throw of a die using random.randint (1, 6). The structure of the program will be as follows:

```import random

# simulate a single round of craps and
# return 1 if player wins and 0 if he loses
def craps ():
# write the body of the code

def main():
# prompt the user to enter the number of rounds
num_rounds = int (input ("Enter number of rounds: "))

# compute the number of times he wins
num_wins = 0
for n in range (num_rounds):
num_wins += craps()

# print the result
print ("Player wins", num_wins, "out of", num_rounds, "rounds.")

main()
```

The program that you will be writing will be called Craps.py. We will be looking at good documentation, design, and adherence to the coding convention as discussed in class. Your file Craps.py will have the following header:

```#  File: Craps.py

#  Description:

#  Student Name:

#  Student UT EID:

#  Course Name: CS 303E

#  Unique Number:

#  Date Created: