Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Craps is a dice-based game played in many casinos. Like blackjack, a player plays against the house. The game starts with the player throwing a

Craps is a dice-based game played in many casinos. Like blackjack, a player plays against the house. The game starts with the player throwing a pair of standard, six-sided die. If the player rolls a total of 7 or 11 in the first round, the player wins. If the player rolls a total of 2, 3, or 12 in the first round, the player loses. For all other roll values, the player must roll again to determine whether he/she has won or lost. In the second and subsequent rounds the player rolls the pair of dice again. If the player matches the roll value 2/27/2018 Assignment 9 -- CSC 241-801 file:///Users/bmaya/Documents/DePaul_Teaching/17-18_WQ/csc241W2017Hws/assign9.html 3/5 from the first round again, he/she wins. If the player rolls a 7, he/she loses. Play continues into another round until the initial roll is matched (for a win) or a 7 is rolled (for a loss).

image text in transcribed

In python plz, screenshot of code helps with indentations

b. Next write a function quietCraps0 that simply returns 0 or 1 but does not display the results of the rolls. It should behave exactly the same way as craps0 but without printing any information. To do this, re-write the crapsO function above so that it takes a parameter that indicates when it should Users/bmaya/Documents/DePaul Teaching/17-18 WQ csc241W2017Hws/assign9 html 3/5 2018 Assignment 9-CSC 241-801 display information about the rolls. Then use that function when writing the quietCraps0 function Note that the craps0 function should still remain callable with no parameters and in that circumstance should behave as described in the previous part. Note that any solution that duplicates code found in the craps0 function won't earn full credit. The quietCraps0 function should simply make an appropriate call to craps0. The following shows several sample runs of the function: Python 3.6.2 Shell File Edit She Debug Options Window Help >>>valquietCraps() >Val >>> val = quietCrap3() >val 0 >>>quietCraps () 0 >>>quietCraps () 0 quietcraps () >>quietcraps () Ln: 147 Col: 4

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions