[Solved] The Wizard's Door. Help!


I can’t figure out the code to The Wizard’s Door and this is my code.


Move to Laszlo and get the secret number from him.

hero.moveXY(30, 13)
secret = hero.findNearestFriend().getSecret()
secretr = secret
number = secret + 7

Follow Laszlo’s instructions to get the magic number!

Move to Erzsebet and say her magic number.

hero.moveXY(17, 26)
number = (7 + secret) % 4

Move to Simonyi and say his magic number.

hero.moveXY(30, 39)
number = number * secretr

Move to Agata and say her magic number.

hero.moveXY(43, 26)



We can’t see the structure since you didn’t post your code correctly. From now on please paste the code from the game using the </> button so it is formatted properly. Help us help you.

You redefine secret as secretr. All this does is rename the variable, secret. Why?

Also, you are constantly redefining the variable, number. This can be confusing. Why not have a separate variable for each wizard?

secret = hero.findNearestFriend().getSecret()

erz = secret + 7


sim = erz % 4


aga = sim * secret


Obviously, there’s a lot missing from that code and you’ll have to fill in the blanks, but you should at least see how to use a different variable for each wizard. This should be less confusing as each computation has a different name so they’re easier to keep track of.

Also, I know the directions/comments say to use modulo 4 for Simonyi’s number but I had to use “/” (divide) to pass.



Sorry. I don’t get what your are saying.

secret = hero.findNearestFriend().getSecret()

ErzsebetNumber = secret + 7


SimonyiNumber = ErzsebetNumber % 4


AgataNumber = SimonyiNumber * secret


Does that make more sense?



It makes more sense but every time I go to Simonyi and I say 1 she zaps me and I die.


Did you read the last sentence in my first post?



Thank you so much.:grinning:


Thank you so much. It helped me a lot.




(Post must be at least 20 characters)