[~]$ cd [~]$ cd cs21/inclass/If the w07-design directory does not yet exist, create it using mkdir
[inclass]$ mkdir w07-designCopy the sample files for today from my directory using cp
[inclass]$ cp ~adanner/public/cs21/w07-design/* w07-design/ [inclass]$ ls w01-intro/ w02-numAndString/ w03-decisions/ w04-graphics/ w05-functions/ w06-loops/ w07-design/ [inclass]$ cd w07-design/ [w07-design]$ ls colors.txt fileDemo.py [w07-design]$For Thursday, copy a skeleton solution of the craps game to your directory using cp
[inclass]$ cp ~adanner/public/cs21/w07-design/craps_skel.py w07-design/ [inclass]$ ls
Let's demonstrate this idea with the dice game Craps.
A player rolls a pair of six-sided dice.
If the initial roll is 2, 3, or 12, the player loses.
If the initial roll is 7 or 11, the player wins.
Any other initial roll causes the player to "roll for point". This means that the player keeps rolling either until she re-rolls the initial value (a win) or rolls a 7 (a loss).
Let's write a program to simulate multiple games of craps and estimate the probability that the player wins.
Specification
Input: Number of games to simulate
Output: Probability of winning