Answered step by step
Verified Expert Solution
Question
1 Approved Answer
pls use python do this Problem 5. Playing a game A game consists of playing multiple hands. We need to implement one final function to
pls use python do this
Problem 5. Playing a game
A game consists of playing multiple hands. We need to implement one final function to complete our word-game program.
Write the code that implements the play_game function. You should remove the code that is currently uncommented in the play_game body. Read through the specification and make sure you understand what this function accomplishes.
For the game, you should use the HAND_SIZE constant to determine the number of cards in a hand. If you like, you can try out different values for HAND_SIZE with your program.
def play_game(word_list):
"""
Allow the user to play an arbitrary number of hands.
* Asks the user to input 'n' or 'r' or 'e'.
* If the user inputs 'n', let the user play a new (random) hand.
When done playing the hand, ask the 'n' or 'e' question again.
* If the user inputs 'r', let the user play the last hand again.
* If the user inputs 'e', exit the game.
* If the user inputs anything else, ask them again.
"""
# TO DO...
Testing: Try out this implementation as if you were playing the game.
Part B
**Part B is dependent on your functions from ps3a.py, so be sure to complete ps3a.py before working on ps3b.py**
You decide to teach your computer (SkyNet) to play the game you just built so that you can prove once and for all that computers are inferior to human intellect. In Part B you will make a modification to the play_hand function from part A.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started