Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Then wizard's door


Every time I press submit it always makes a new problem like 2+7=9 then I answer i all the question and then it goes 2+5 and I get them all wrong.


Most of our levels contain an element of randomness, so that you can’t hard-code the answer.

In The Wizard’s Door you want to use code to calculate the answer based on the secret number given to you (which will change).

las = hero.findNearestFriend().getSecret()
erz = las + 7

If you hard-code the answer (like hero.say("9")) it won’t work when the secret number changes.