


In addition to having all of the instance variables and methods that WOFPlayer has, WOFHumanPlayer should have an additional method: This class is going to represent a human player. Next, we’re going to define a class named WOFHumanPlayer, which should inherit from WOFPlayer (part A). Steve ($1800) (for a player with instance variables. _str_(): Returns the player’s name and prize money in the following format: addPrize(prize): Add prize to self.prizes addMoney(amt): Add amt to self.prizeMoney It should also have the following methods (note: we will exclude self in our descriptions): prizes: The prizes this player has won so far (a list, initialized to ) prizeMoney: The amount of prize money for this player (an integer, initialized to 0)

name: The name of the player (should be passed into the constructor) Every instance of WOFPlayer has three instance variables: We’re going to start by defining a class to represent a Wheel of Fortune player, called WOFPlayer. N = int(userinp) # try casting to an integerĮrrmessage = 'Must be at most """.format(category, obscuredPhrase, ', '.join(sorted(guessed))) Userinp = input(prompt) # ask the first time # Repeatedly asks the user for a number between min & max (inclusive) Read their implementation and make sure they make sense. We’re going to define a few useful methods for you. The game can also be easier for users to understand if not everything happens instantly. You’ll find that we can build a little suspense during gameplay with some well-placed delays.
#Expresso cookie voice actor code#
The time.sleep(s) function (from the time module) delays execution of the next line of code for s seconds. The active code window that starts with “Part A” is where you are first asked to complete code. There are no questions to answer in these next few active code windows, they are just here to introduce or reintroduce you to some functions and methods that you may not be aware of. The game continues until the entire phrase is revealed (or one player guesses the complete phrase)įirst, let’s learn about a few functions and methods that we’ll use along the way to do this project. However, they keep all of the prizes they have won so far. If the wheel lands on “bankrupt”, the player loses their turn and loses their money. If the wheel lands on “lose a turn”, the player loses their turn and the game moves on to the next player If they are incorrect, it is the next player’s turn
