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

The Wizards Door Bug success /no success


I think it’s a bug code run properly. I can see "
success " and I am able to find the hidden door. But when I was traying to send my answer system give me a note that I wrote my code wrong. That’s not true. I dont know why when I was sending my result (the full screen moment) Laszlo taled diferent first number than before when code run properly.
Next time I changed :

var aga =sim*x

x was the number I wrote befour and code run properly -1 . I sended my result. It was a little confusing but can help.

Does anyone had problem like this or it’s just my luck :wink:


Make sure you read the comments to figure out how to solve the level. If you need to, you can reset the level to bring the old comments back.

// Multiply Simonyi's number by Laszlo's to get Agata's number.
var aga = sim * x; // fix this (hint: only the x needs to be replaced)
// finish up the level


I solved the level. The problem was why is the difference between first success information and no success information when I was sending results. When I wrote code e.g. it was

var aga= sim*3;

I get success information. So the level was solved. But when I press send result First number was different and he told not 3 but 2 and I don’t understand why. First time I see something like this, that I must change good code before sending but after “success” :wink:


The numbers are randomly generated everytime. You already have the magic number stored in a variable, though.
Check the comment right above the calculation again:

// Multiply Simonyi's number by Laszlo's to get Agata's number.

So, you have 4 variables in this program: las, erz, sim, and aga.
Instead of using a constant number (which was 3 in your latest post), you should replace it with the variable you need.


var a = 3
var b = 4
var cSquared = (a * a) + (b * b) // notice how there aren't any numbers written here?


I know that the numbers are randomly generated everytime. But it should not be changed between you got success and open the wizard door and sendind the solution again on the full screen moment and you see red no success note :wink:
Everything is ok about your solution when you are not able to get green success information but after you see that information, code should not be changed by program in no circumstances.


The level is working as it should. The numbers are randomized between your test run and your submit run.
Try to find a solution that works 100% of the time you submit.

Let’s finish this level because it has an important concept.

var aga = sim * x; // replace the x with the correct variable

Variables to choose from: las, erz, sim, and aga
Which variable should replace x so the code goes along with the following comment?
// Multiply Simonyi's number by Laszlo's to get Agata's number.


The goal is to teach you to make a code that will work for any iteration of the level. Otherwise, you could just hard code an answer to beat one version of the level.

Think of the run that happens before you click “Submit” as a practice run.



So it should go with warning, don’t panic :stuck_out_tongue:


mine changes every time


Yes – this is so you can’t just put ‘7’ as an answer. Each time you have to use the variables to correctly answer the wizards.


every time i put a different number i run the program and after when i click submit the coding i put is all wrong Why???


This is not a bug. It is intentional. The reason is to force you to use variables instead of using numbers as constants. A variable will change with the circumstances. A number won’t. If you need to review what variables are and how to use them, then go back and redo some previous levels.