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 to labs and lectures. All the tools you need to do this assignment can be found there. Use nesting, Boolean expressions, andor helper functions as appropriate to keep the code as short and clear as possible.
Number Guess
Write a function called playnumberguessguess that accepts the player's integer guess as an argument. The function simulates the rolling of two sixsided 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 point if they are within of the actual result, points if they are within of the actual result, and points if they get it exactly right. Otherwise, they get points.
Modified RPSLS
Write a function called
playmrpslsmove 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 points. If they lose, they get points. If they tie, they get points.
Coin Flips
Write a function called playcoin 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 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 gamesroomname 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 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 printsignature function that behaves as described in the Computing PreLab Exercise. Then it should ask the user for their name, call the gamesroomname function, and then print the final score returned by that function.
These functions may require techniques that you will learn in Computing Indefinite Iteration
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
