Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(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.

image text in transcribed
(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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Programming questions