Question: (Random, 15 pts} Craps is a dicebased game played in many casinos. The game starts with the player throwing a pair of standard, sixsided dice.

 (Random, 15 pts} Craps is a dicebased game played in many

(Random, 15 pts} Craps is a dicebased game played in many casinos. The game starts with the player throwing a pair of standard, sixsided dice. If the player rolls a total of ? or 11, the player wins. If the player rolls a total of 2, 3 or 12, the player loses. For all other roll values, the player will repeatedly roll the pair of dice until either she rolls the initial value again (in which case she wins] or 7 (in which case she loses}. Write a function craps\" that takes no arguments, simulates one game of craps, and returns 'I win' if the player won and 'I lost' if the player lost. Consider implementing a second function if the player does not win or lose on the initial roll- 3-)} crap: { l E 3 6 ' I win' 3})- crap: I] .3, 'I won' )0} crap: { l 5 B 6 'T 'I lose'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!