Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Python Coding. create this program and explain each function of coding. Part A Rules: At the start of each game, the player specifies a

Using Python Coding. create this program and explain each function of coding.
Part A
Rules: At the start of each game, the player specifies a number between 5 and 9 inclusive
this is called the main. The player then throws two dice.
If the main is rolled, the player wins
If a 2 or a 3 is rolled, the player loses
If an 11 or 12 is rolled, the result depends on the main:
With a main of 5 or 9, the player loses
With a main of 6 or 8, the player loses with an 11, but wins with a 12
With a main of 7, the player wins with an 11, but loses with a 12
If any other number is rolled, then this is called the chance.
The player throws the dice again:
If the chance is rolled, the player wins
If the main is rolled, the player loses
The player keeps rolling until they roll either the chance or the main
The first part of this assignment is to implement the code for one game.
Part B Additional Features
Game Loop Provide the ability for the user to play more than one game.
Suggestion: Initialize a variable called play at the top of your program. You could
initialize it to a Boolean value or a string. If you do this, then the pseudo code for your
game loop could look something like this:
while play is equal to whatever you set it to
All the code from Part A
At the very bottom of the loop ... Ask the user if they want to play again
If they do not, then set play to what you need it to be
Otherwise, let the game loop to start again
NOTE: At the start of each game, the user must be told which game they are on
(ie, Game 1... Game 10... Game 50).
Game Playability Make your game user-friendly and playable. You need to decide what
the interaction with the user will look like. There needs to be significant effort put in trying
to make the game look nice spacing, underlining, clear messaging etc.
Farewell Message When the player decides to not play again, give a final report that
includes the total number of games won and the total number of games lost.

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

Deductive And Object Oriented Databases Second International Conference Dood 91 Munich Germany December 18 1991 Proceedings Lncs 566

Authors: Claude Delobel ,Michael Kifer ,Yoshifumi Masunaga

1st Edition

3540550151, 978-3540550150

More Books

Students also viewed these Databases questions

Question

Outline psychological and social-cultural triggers of aggression.

Answered: 1 week ago

Question

What is linear transformation? Define with example

Answered: 1 week ago