python - Syntax Error on line 36 -
i keep getting syntax error on line 36 of text based adventure.
i've added #line 36
@ end of line tell is. have tried can think of fix this. missing?
#adventure #setting print ("*you wake in dark room on mattress on floor*") #wait before running next command make seem more real , more real thought. import time time.sleep(1) #introduce map print ("*you left , there wall, right , find short table map on it*") import time time.sleep(1) print("*you pick map*") map = """ |---------------------| | | | start | | | | | |---------------------|""" print (map) def goto(linenum): global line line = linenum line = 1 while true: if line == 1: response = raw_input("would explore around room or move next room? (type explore ,or move-on): ") if response == "explore": map = """ |---------------------|---------------------| | | | | start | room 2 | | | | | | | |---------------------|---------------------|""" print (map) elif response = "move-on": #line 36 map = """ |-------------------------------------------| | | | [chest] | | d | | o | | o | | (table) r | | {bed} | |-------------------------------------------|""" print (map) else: goto(100) break elif line == 100: print "your input invalid" goto(1)
you don't need import modules multiple times (ie, import time
once @ beginning)..
that being said, print statement:
print (map)
is incorrectly indented (both times called [ line 35 , line 47 ])
there may other issues well, 1 code blowing on currently.
Comments
Post a Comment