Question: Design and implement a program that allows the user to play a game similar to Wheel of Fortune. Wheel of Fortune is a popular word



Design and implement a program that allows the user to play a game similar to Wheel of Fortune. Wheel of Fortune is a popular word game in which the player is given a category (Movie, Famous Person) and some number of blanks representing each character in the name of the movie or person. The user guesses one letter at a time and the program updates the display to include the letter where it appears in the name. The program should also display any character that was guessed incorrectly as well as the number of incorrect guesses remaining. The game ends when the user has filled in all of the characters or has reached the guessed incorrectly 5 times for a particular puzzle. The user should be allowed to play puzzles repeatedly and the program should keep track of how many puzzles the user has completed successfully.


Here is the code that is provided.


import random


def getPuzzle():

\"\"\"This function returns a tuple (Category, Phrase) that can be used to play a simple game of like

Wheel of Fortune.\"\"\"

puzzles = [(\"Famous People\", \"Abraham Lincoln\"), (\"Famous People\", \"Oprah Winfrey\"),(\"Famous People\", \"Will Smith\"),

(\"Famous People\", \"Marilyn Monroe\"),

(\"Action Movie\", \'Mad Max: Fury Road\'),

(\"Action Movie\", \'Die Hard\'),

(\"Action Movie\", \'John Wick\'),

(\"Action Movie\", \'Enter the Dragon\')]

index = random.randint(0, len(puzzles))

return puzzles[index]


def main():

\"\"\"docstring comment for the program goes here\"\"\"

(category, name) = getPuzzle()

print(category)

print(name)



if __name__ == \'__main__\':

main()



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!