Here's the basic idea I'm having trouble with: I'm trying to make a simple game where you are in one room and you have 2 rooms branching from the first that need to be "completed" before continuing. I want the 2'nd and 3'rd room to change my original True
statements to False
statements that all need to be switched before proceeding in the game.
from sys import exit
def room_1():
print "You're in room one, there are two doors to room 2 and 3."
print "Where do you want to go?"
done_2=True
done_3=True
while True:
move=raw_input("'room 2' or 'room 3'? >")
if move == 'room 2':
room_2()
elif move == 'room 3':
room_3()
else:
print "not a valid answer"
print "You Win!"
exit(0)
def room_2():
print "You finished room 2!"
done_1=False
raw_input('Press button')
room_1()
def room_3():
print "You finished room 3!"
raw_input('press button')
done_3=False
room_1()
room_1()
How do I change the done_ statements from within rooms 2 and 3? ~