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_2

Step: 3

blur-text-image_step3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

ISBN: 3319234609, 978-3319234601

More Books

Students also viewed these Databases questions

Question

5. Prepare a plan of action and execute itstarting now!

Answered: 1 week ago

Question

Lo6 Identify several management development methods.

Answered: 1 week ago