Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is the question: You will write a program that simulates a game called High Point Craps. High Point Craps is another fun game that

Here is the question:

You will write a program that simulates a game called High Point Craps.

High Point Craps is another fun game that uses two dice. Each die has six faces representing values 1, 2, ..., and 6, respectively.

The user starts the game by rolling two dice.

Check the sum of the two dice.

An initial roll of 2 or 3 is ignored until a different total is made.

A roll of 11 or 12 makes you win even money (1:1), and anything else sets the Point number.

Now you have to roll a number higher than the Point to win, and you get 2 tries to do this.

In otherwords, if you roll a number less than or equal to the point on the first roll after the point is established, you have one more chance to roll. If you roll a number greater than the point, you win. If you roll anything less or equal to the point on the second roll and you lose.

You must use either a for loop or a while loop when rolling the dice after the point is established - you cannot just use if statements to accomplish the potential multiple rolls. You must also remember to incorporate functions into your code and should create the following functions:

A function called Roll_Dice to roll the two dice.

A function called Even_Money_Check to determine if the user won "even money".

A function called Process_Point to handle all the tasks needed to be performed if the initial roll set a Point number.

You must only use Python tools we have covered in class or the textbook. You must not use anything found on Chegg, Stackoverflow, etc.

** You may only use tools and techniques that we covered in class. You cannot use tools, methods, keyword, etc. from sources outside of what is covered in class.

HERE IS MY CODE. I WANT TO MAKE SURE MY PROGRAM IS CODED CORRECTLY

import random

roll_again = 'y'

while roll_again == 'y': first_roll = random.randint(1,6) second_roll = random.randint(1,6) total= first_roll + second_roll print("Your dice rolled:", first_roll, "and", second_roll) while total in range(2,4): continue

if total in range (11,13): print(" YOU WIN!!! ")

else: print("You have 2 tries to get a higher number","and your total is:", total,': ')

for number in range(2): roll1 = random.randint(1,6) roll2 = random.randint(1,6) score = roll1 + roll2 print( 'Your dice rolled:', roll1, 'and',roll2, ' and your total is:', score)

if score > total: print(" YOU WIN!!! ") break

else: print(" You Lose! ")

play_again = input("Type y to play again: ")

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

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

2. How will you handle the situation?

Answered: 1 week ago