0% found this document useful (0 votes)
3 views1 page

Simple Puzzle Game with Fun Riddles

The document describes a Simple Puzzle Game class that presents users with a series of puzzles to solve. Players input their answers, and the game keeps track of their score based on correct responses. At the end of the game, the total score is displayed to the player.

Uploaded by

vamshikrish2457
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Simple Puzzle Game with Fun Riddles

The document describes a Simple Puzzle Game class that presents users with a series of puzzles to solve. Players input their answers, and the game keeps track of their score based on correct responses. At the end of the game, the total score is displayed to the player.

Uploaded by

vamshikrish2457
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

class SimplePuzzleGame:

def __init__(self):
[Link] = {
"I’m tall when I’m young, and I’m short when I’m old. What am I?":
"candle",
"What has to be broken before you can use it?": "egg",
"I’m light as a feather, yet the strongest man can’t hold me for much
longer than a minute. What am I?": "breath",
"What has many keys but can’t open a single lock?": "piano",
}
[Link] = 0

def play(self):
print("Welcome to the Simple Puzzle Game!")
print("Try to solve these easy puzzles!\n")

for question, answer in [Link]():


user_answer = input(f"Puzzle: {question}\nYour answer:
").strip().lower()
if user_answer == answer:
print("Correct!\n")
[Link] += 1
else:
print(f"Wrong! The correct answer was: {answer}\n")

print(f"Game over! Your total score is {[Link]}/{len([Link])}.")

if __name__ == "__main__":
game = SimplePuzzleGame()
[Link]()

You might also like