Question: The Game Room In this assignment, you'll create functions to implement three simple games, then write a program that lets the user play a series

The Game Room
In this assignment, you'll create functions to implement three simple games, then write a program that lets the user play a series of games against the computer and reports their final score.
For this assignment, you are only allowed to use the features of Python that you were shown in computing 1 to 5 labs and lectures. All the tools you need to do this assignment can be found there. Use nesting, Boolean expressions, and/or helper functions as appropriate to keep the code as short and clear as possible.
Number Guess
Write a function called play_number_guess(guess) that accepts the player's integer guess as an argument. The function simulates the rolling of two six-sided dice and adding them up, then assigns a score based on how close the guess was to the result of the dice.
Print out a single line of output containing the name of the game, the dice sum, the player's guess, and the number of points the player receives. Return the number of points the player receives.
Scoring Rules: The player gets 1 point if they are within 4 of the actual result, 5 points if they are within 2 of the actual result, and 10 points if they get it exactly right. Otherwise, they get 0 points.
Modified RPSLS
Write a function called
play_mrpsls(move) that plays a
game of Modified Rock Paper Scissors
Lizard Spock. It accepts a player
move as a parameter, generates a
random computer move, and displays
the result.
The chart at right shows the rules for
RPSLS. Use it to determine who wins but modify it so that Spock and the lizard are swapped.
Print (on one line) the name of the game, the player and computer moves and how many points the player receives. Return the number of points the player receives.
Scoring Rules: If the player wins, they get 10 points. If they lose, they get 0 points. If they tie, they get 5 points.
Coin Flips*
Write a function called play_coin(). The function should simulate flipping a coin repeatedly.
Print out a single line of output containing the name of the game, the result of each coin flip and the number of points the player receives. Return the number of points the player receives.
Scoring Rules: If the first flip is tails, the user gets 2 points for every time they flip heads until the next tails, then the game is over. If the first flip is heads, the user gets one point for every time they flip tails until they have flipped heads another two times, then the game is over.
The Games Room*
Create a games_room(name) function that plays games with the user. Greet them by name (their name is passed as an argument to the function). Then repeatedly do the following: tell them their current point total, ask them which game they want to play from a menu of 3 games, then ask them for their guess or their move (if required), call the appropriate function, and add the result to their score. Repeat until the player decides that they want to quit (you might have a quit option on the menu, or you might ask them after each game.) If they choose a game that's not on the menu, dock them a randomly determined number of points and print an error message that lets them know how many points they lost.
When the user chooses to quit, return the total score.
The Main Program
When the program is run, it should first call a print_signature() function that behaves as described in the Computing 3 Pre-Lab Exercise. Then it should ask the user for their name, call the games_room(name) function, and then print the final score returned by that function.
These functions may require techniques that you will learn in Computing 5(Indefinite Iteration).
The Game Room In this assignment, you'll create

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!