Glen Edwards
Glen Edwards

Reputation: 63

Syntax Error on line 36

I keep getting a syntax error on line 36 of my text based adventure.

I've added #line 36 at the end of the line to tell you where it is. I have tried everything I can think of to fix this. What am I missing?

#Adventure
#Setting
print ("*You wake up in a dark room on a mattress that is on the floor*")
#Wait before running next command to make it seem more real and more like a real thought.
import time
time.sleep(1)
#Introduce the Map
print ("*You look to your left and there is a wall, you then look to your right and find a short table with a map on it*")
import time
time.sleep(1)
print("*You pick up the map*")
map = """
                        |---------------------|
                        |                     |
                        |        Start        |
                        |                     |
                        |                     |
                        |---------------------|"""
print (map)
def goto(linenum):
    global line
    line = linenum
line = 1
while True:
    if line == 1:
        response = raw_input("Would you like to explore around the room or move to next the 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 is invalid"
        goto(1)

Upvotes: 2

Views: 260

Answers (2)

Fenny
Fenny

Reputation: 41

change elif response = "move-on": #line 36 to elif response == "move-on": #line 36. You forget the equals mark

Upvotes: 1

Chris Robak
Chris Robak

Reputation: 118

you don't need to import modules multiple times (ie, just import time once at the beginning)..

that being said, you print statement:

print (map)

is incorrectly indented (both times it is called [ line 35 and line 47 ])

there may be other issues as well, but that is the one your code is blowing up on currently.

Upvotes: 1

Related Questions