Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in python plz, screenshot of code helps with indentations 2. Craps is a dice-based game played in many casinos. Like blackjack, a player plays against
in python plz, screenshot of code helps with indentations
2. 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 LTeaching/17-18 WQcsc241W2017Hws/assign9 html 205 7/2018 Assignment 9-CSC 241-801 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). a. Write a function craps0 that does not require any parameters, simulates one game of craps, and returns 1 if the player won and 0 if the player lost. It should also print a history of the rolls so that the player can verify that the function is doing the right thing. The following shows several sample runs of the function: Python 3.6.2 Shell File Edit Shel Debug Options Winw Help >>> val = craps() Roll: 4 and 1=5 Roll: 2 and 2 4 Roll: 1 and 23 Roll: 5 and 2-7 >val 0 >>> val = craps() Roll: 5 and 1=6 Roll: 1 and 2-3 Roll: 3 and 2-5 Roll: 6 and 612 Roll: 2 and 3-5 Roll: 5 and 6-11 Roll: 1 and 2 3 Roll: 6 and 2 8 Roll: 3 and 69 Roll: 5 and 38 Roll: 1 and 4-5 Roll: 1 and 12 Roll: 5 and 5- 10 Roll: 4 and 6=10 Roll: 4 and 2 6 val >>>val-craps ) Roll: 5 and 5-10 Roll: 4 and 48 Roll: 3 and 4-7 val 0 >>valcraps() Rol: 1 and 4-5 Roll: 2 and 46 Ro 11 : 6 and 5-11 Roll: 3 and 3 6 Roll: 3 and 2 5 val >>valcraps () Roll: 4 and 3-7 >>valStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started