The Wizards Door Bug


#1

Hello there,
I was wondering if you can help me with this level? I have been trying to get through the level but it just seems there is a weird bug. I was trying to type in the code, but then it appeared with a message saying:
Line 9: TypeError: Attempted to assign read-only property.
I don’t know what I got wrong with the level, so I would like to show you my code.

hero.moveXY(30, 13);
var las = hero.findNearestFriend().getSecret();
var erz = las + 7;
hero.moveXY(17, 26);
hero.say(erz);
var sim = erz % 4;
hero.moveXY(30, 39);
hero.say(sim);
var aga = sim * laz;
hero.moveXY(43, 26);
hero.say(aga);

It only highlights the say commands with the read-only property. Can you fix the problem, please?


#2

So this is an error that I don’t care for too much myself. In general it indicates that you probably misspelled something. So check that first, if you have not, then look to see if you can actually use that command. I have had times when my gear was different and I wasn’t able to use a command from prior code.

I would check line 9 again and ask yourself those questions.


#3

I have tried what you asked, but it still doesn’t work. I even changed sim to 1, but it just went to line 8 and said the attempt to read the read-only property. I really think this is a bug and I have no way around it.


#4

Apparently, when I stripped down to only wearing boots, leaving the comments and doing this:

[redacted, please don’t post solutions]

It works. So thanks.


#5

just remember line 2:

las

line 9

laz


#7

@Watermeloon9
Please don’t post finished solutions. This board isn’t here to provide solutions just so that people can move on to the next level. It’s here to help people find the solutions so that when they move to the next level, they know how to find the solution on their own. You can’t learn to code if you don’t learn how to figure things out. Being given solutions is counter-productive to this goal. Thanks.