[SOLVED]Cluttered Corridors (python)


#1
# Help the pet find the exit.

def onHear(event):
    word = event.message
    # Convert the word to lower case.
    word = phrase.toLowerCase
    if word == "north":
        pet.moveXY(pet.pos.x, pet.pos.y + 16)
    elif word == "east":
        pet.moveXY(pet.pos.x + 12, pet.pos.y)
    elif word == "south":
        pet.moveXY(pet.pos.x, pet.pos.y - 16)
    elif word == "west":
        pet.moveXY(pet.pos.x - 12, pet.pos.y)

# Assign the event handler for the pet's "hear" event.
pet.on("Hear, onHear")


Movies-Whats your favorite?
#3

u put the quotes wrong.


#4

@SuperSmacker This is now my code

# Help the pet find the exit.

def onHear(event):
    word = event.message
    # Convert the word to lower case.
    word = phrase.toLowerCase
    if word == "north":
        pet.moveXY(pet.pos.x, pet.pos.y + 16)
    elif word == "east":
        pet.moveXY(pet.pos.x + 12, pet.pos.y)
    elif word == "south":
        pet.moveXY(pet.pos.x, pet.pos.y - 16)
    elif word == "west":
        pet.moveXY(pet.pos.x - 12, pet.pos.y)

# Assign the event handler for the pet's "hear" event.
pet.on("hear", onHear)


#5

@Enderlord832 This is the topic.


#6

ok i dont really see what is wrong. it seems correct. What is your problem


#7


#8

Use word not prase cuz phraze is not defined but word is


#9
# Help the pet find the exit.

def onHear(event):
    word = event.message
    # Convert the word to lower case.
    word = word.toLowerCase()
    if word == "north":
        pet.moveXY(pet.pos.x, pet.pos.y + 16)
    elif word == "east":
        pet.moveXY(pet.pos.x + 12, pet.pos.y)
    elif word == "south":
        pet.moveXY(pet.pos.x, pet.pos.y - 16)
    elif word == "west":
        pet.moveXY(pet.pos.x - 12, pet.pos.y)

# Assign the event handler for the pet's "hear" event.
pet.on("hear", onHear)


#10

I fixed it but it said I ran out of time.


#11


#12

Then i dont know whats wrong


#13

ooof you try on your computer or something


#14

see if it works on yours…
(2o chars)


#16

30%20PM


#17

The code works fine for me.


#18

Do you have the right book equiped that give the String.ToLowerCase() Function ?
if you don’t you will have to make your own lowercase function.


#19

@Gamestack don’t use griffin pet. it drifts and causes problems.


#20

Isn’t the griffin pet the default pet in this level?


#21

yay I did it thx. :yum::yum::yum: