Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program must be created in Python and cannot use def functions except for def main. Please help thanks! BONUS PART]: ROLLING THE DICE Write

This program must be created in Python and cannot use def functions except for def main. Please help thanks! image text in transcribed
BONUS PART]: ROLLING THE DICE Write a program rolling dice-py that is a game of pure luck. You will be using a tuple throw to keep the results of the two dice in every throw. Rules: Roll two 6-sided dice. If the result of the sum of the two dice is: 7 or 11 on first throw, player wins 2, 3, or 12 on first throw, player loses . 4, 5, 6, 8,9, 10-value becomes player's "point o Player must roll for his "point" to win) before rolling 7 Player keeps rolling the dice until either rolling a 7 (player loses) or re-rolling the value of the initial roll (player wins) Outline of your progr the following: (1) Initialize the Game by printing the rules of the game. (2) Roll the two dice am: As it will be described in more detail in the sections below your program should do (3) Check the sum of the values from the 2 dice against the rules(using the built-in sum function). (4) Check if there is a win/lose or you need to roll again. (S) Extra Challenge: Compute statistics for the game (see below "Implementation Details Implementation Details & Hints * Use a tuple( throw) to keep the result of the two dice for every throw .Use the built-in sum() function to sum the values of the tuple (throw) Extra challenge: Estimate the probability of a player winning. Simulate multiple games and keep track of the wins. The probability of the player winning is computed by: number of wins) (total number of games) [for extra challenge] You need to ask the user the total number of games the program should use for the statistics computation

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

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

=+ 2. What is the opportunity cost of seeing a movie?

Answered: 1 week ago

Question

=+ what roles should government play in them ?

Answered: 1 week ago

Question

=+ Why do we have markets and, according to economists,

Answered: 1 week ago