Trouble going to different rooms in my basic Python text adventure -


i in intro programming class , have been trying create simple text adventure every time (try) go different room name error saying particular room isn't defined. thought because called room after else statement @ end , again right underneath didn't change anything.

#this random text adventure game. enjoy!  def main():     print("you wake in cave without clue of how got there. head throbbing. \ninsistent on figuring out happened you, decide explore cave in search of answers. \n")     print("you can following things: \n"         "'go left' - explore tunnel on left. \n"         "'go right' - explore tunnel on right. \n") #evaluates player's choice.     choice = input("what do?: ")     if choice == 'go left':         print("you stumble way down left tunnel.\n")         left_cave()     if choice == 'go right':         print("you stumble way down right tunnel.\n")         right_cave()     else:         print("that's not direction.. maybe head hurting because don't know left , right means. :d\n") main()  #defines left cave. def left_cave():     print("after short walk find in smaller room room woke in. \n there writing on walls.")     print("you can following things: \n"         "'examine' - examine writing on wall. \n"         "'look around' - take around room. \n"         "'go back' - go main room. \n")     choice = input("what do?: ")     if choice == 'examine':         print("i see have made far.  if want know happened have make end of cave.")         middle_room()     if choice == 'look around':         print("you see darkly lit room.  room smells.  notice writing on wall again.")         left_cave()     if choice == 'go back':         print("you make way room woke in.")         main()     else:         print("there nothing in room matches that.. c'mon.") left_cave() 


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -