Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program a simple game application that allows a single player to play a guessing game repeatedly on python . Question 3 A simple game application

Program a simple game application that allows a single player to play a guessing game repeatedly on python.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Question 3 A simple game application allows a single player to play a guessing game repeatedly Game play The player has 50 chips at the start of the session. Before every new game, the player enters a positive number that is at least 4, e.g.. 7 A random sequence of whole numbers from to that number is then generated, e.g. 524 16 73. The first number is revealed to the player, in this case, 5. He makes a guess whether the next number is higher (h) or lower (1) than the number just revealed, and then places the number of chips he wishes to bet with. The player may also choose to skip guessing by entering an empty string. Whether the player makes a guess or skips, the next number is revealed, in this case, 2. If the player makes a guess and the guess is correct, he wins some chips, an amount described under the heading Bet Amount Otherwise, he loses the chips he bets with. Display the number of chips the player has after computing his win or loss, or after his skip, on the console (output screen) as well as into a file, Q3Out.txt. The game continues with the player guessing or skipping until the third number from the end (or right) of the sequence is revealed, in this case 6. Then the game ends. This means that the player gets to make a guesses up to 3 less than the number he enters before the game st arted. In the example case, the player gets to make at most 7-3-4 guesses. The first number revealed to the player is 5 before any guess is made. Subsequently, after each guess or skip, the numbers 2, 4, 1 are revealed. After the number 1 is revealed, the player can make his last guess, and the last number revealed is 6. The last 2 numbers of the generated sequence are not revealed in each game Question 3 A simple game application allows a single player to play a guessing game repeatedly Game play The player has 50 chips at the start of the session. Before every new game, the player enters a positive number that is at least 4, e.g.. 7 A random sequence of whole numbers from to that number is then generated, e.g. 524 16 73. The first number is revealed to the player, in this case, 5. He makes a guess whether the next number is higher (h) or lower (1) than the number just revealed, and then places the number of chips he wishes to bet with. The player may also choose to skip guessing by entering an empty string. Whether the player makes a guess or skips, the next number is revealed, in this case, 2. If the player makes a guess and the guess is correct, he wins some chips, an amount described under the heading Bet Amount Otherwise, he loses the chips he bets with. Display the number of chips the player has after computing his win or loss, or after his skip, on the console (output screen) as well as into a file, Q3Out.txt. The game continues with the player guessing or skipping until the third number from the end (or right) of the sequence is revealed, in this case 6. Then the game ends. This means that the player gets to make a guesses up to 3 less than the number he enters before the game st arted. In the example case, the player gets to make at most 7-3-4 guesses. The first number revealed to the player is 5 before any guess is made. Subsequently, after each guess or skip, the numbers 2, 4, 1 are revealed. After the number 1 is revealed, the player can make his last guess, and the last number revealed is 6. The last 2 numbers of the generated sequence are not revealed in each game

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_2

Step: 3

blur-text-image_3

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 Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

More Books

Students also viewed these Databases questions

Question

Give an example of a molecule that has a coordinate covalent bond.

Answered: 1 week ago

Question

Advance warning and an explanation for the layoff.

Answered: 1 week ago

Question

Assessment of skills and interests.

Answered: 1 week ago