好的,所以我试图设置一个布尔值,以便如果采用某项,则它变为True,而如果下次采用True,则它采用不同的路径,这是我第一次用Python写东西,所以请原谅错误的代码约定。无论如何,我需要在记笔记之前将布尔值设置为False,并且在需要时将其设为True。将来我可能会遇到的一个问题是,玩家有一部分会回到这个房间,当他们这样做时,我该如何保持布尔值真实?
def first_room(Note):
choice1_1 = raw_input('The house looks much larger than it did from the outside. You appear in a room, to your left is a closet, to your right is a pile of junk, in front of you is a door, and behind you is the exit.')
choice1_1 = choice1_1.lower()
if choice1_1 == 'left' or choice1_1 == 'l' or choice1_1 == 'closet':
if note == False:
choice1_c = raw_input('You open the closet and check inside, there is a note. Do you take the note? (Y/N)')
choice1_c = choice1_c.lower()
if choice1_c == 'y':
print 'You took the note.'
first_room(True)
if choice1_c == 'n':
print 'You leave the note alone.'
first_room(False)
else:
print 'The closet is empty.'
first_room(True)
first_room(False)
交互式爱情
慕妹3242003
相关分类