Reputation: 7
#adventure game When the user enters the wrong room and die I want it to go back to the question of what room to enter
prompt = print("You are in a room by yourself. There are three doors; Red, Blue, and Green. Which door are you picking")
user = input("Room?: ")
def red():
print("You enter the red room and die")
def blue():
print("You enter the blue room and freeze to death")
def green():
print("You enter the green room and proceed")
if user == "r":
red()
print(prompt)
elif user == "b":
blue()
print(prompt)
elif user == "g":
green()
print(prompt)
Upvotes: -1
Views: 128
Reputation: 33359
Wrap the logic in a while True
loop.
As long as you don't break out of the loop, it will keep repeating.
Upvotes: 0