Help with level " The Wizards Haunt "

Hello !

I have tried to solve the level " The Wizard’s Haunt " but I can’t figure out why my code isn’t working ?

# Move to 'Zsofia' and get the secret number from her.
hero.moveXY(18, 20)
zso = hero.findNearestFriend().getSecret()

# Divide 'Zsofia's number by 4 to get 'Mihaly's number.
# Move to 'Mihaly' and say his magic number.
mih = zso / 4
hero.moveXY(30, 15)
hero.say(mih)

# Divide 'Mihaly's number by 5 to get 'Beata's number
# Move to 'Beata' and say her magic number.
bea = zso / 5
hero.moveXY(42, 20)
hero.say(bea)
# Subtract 'Beata's number from 'Mihaly's to get Sandor's number.
# Move to 'Sandor' and say his magic number.
san = mih - bea
hero.moveXY(38, 37)
hero.say(san)

Thank you :)

- mitosis

Right here:

# Divide 'Mihaly's number by 5 to get 'Beata's number
# Move to 'Beata' and say her magic number.
bea = zso / 5

it says you need to divide Mihaly’s number by 5, not Zsofia’s

1 Like

:person_facepalming: I can’t believe I missed that !

Thank you so much, that solved the problem :D

You’re welcome, I sometimes miss stuff like that too! No worries, that’s pretty much what coding is - making mistakes before you get it right

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.