# The Wizards Door Bug

**URL:** <https://discourse.codecombat.com/t/the-wizards-door-bug/8269>\
**Category:** Uncategorized\
**Created:** [July 3, 2016, 10:31pm UTC](https://discourse.codecombat.com/t/the-wizards-door-bug/8269 "2016-07-03T22:31:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Death01](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/death01/32/4231_2.png) [@Death01](https://discourse.codecombat.com/u/Death01)\
**Post date:** [July 3, 2016, 10:31pm UTC](https://discourse.codecombat.com/t/the-wizards-door-bug/8269/1 "2016-07-03T22:31:27Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Harry\_the\_Wanderer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/harry_the_wanderer/32/5369_2.png) [@Harry\_the\_Wanderer](https://discourse.codecombat.com/u/Harry_the_Wanderer)\
**Post date:** [July 4, 2016, 12:15am UTC](https://discourse.codecombat.com/t/the-wizards-door-bug/8269/2 "2016-07-04T00:15:05Z")

</div>

> [@Death01](#):
>
> Line 9: TypeError: Attempted to assign read-only property.

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.

---

<div class="post-metadata">

**Author:** ![Death01](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/death01/32/4231_2.png) [@Death01](https://discourse.codecombat.com/u/Death01)\
**Post date:** [July 10, 2016, 11:01pm UTC](https://discourse.codecombat.com/t/the-wizards-door-bug/8269/3 "2016-07-10T23:01:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Death01](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/death01/32/4231_2.png) [@Death01](https://discourse.codecombat.com/u/Death01)\
**Post date:** [July 10, 2016, 11:10pm UTC](https://discourse.codecombat.com/t/the-wizards-door-bug/8269/4 "2016-07-10T23:10:13Z")

</div>

…

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.

---

<div class="post-metadata">

**Author:** ![Harry\_the\_Wanderer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/harry_the_wanderer/32/5369_2.png) [@Harry\_the\_Wanderer](https://discourse.codecombat.com/u/Harry_the_Wanderer)\
**Post date:** [July 11, 2016, 2:53pm UTC](https://discourse.codecombat.com/t/the-wizards-door-bug/8269/5 "2016-07-11T14:53:28Z")

</div>

just remember line 2:

las

line 9

laz

---

<div class="post-metadata">

**Author:** ![MunkeyShynes](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/munkeyshynes/32/9277_2.png) [@MunkeyShynes](https://discourse.codecombat.com/u/MunkeyShynes)\
**Post date:** [December 19, 2017, 9:35pm UTC](https://discourse.codecombat.com/t/the-wizards-door-bug/8269/7 "2017-12-19T21:35:00Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Giovanni\_Busacca](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/giovanni_busacca/32/20806_2.png) [@Giovanni\_Busacca](https://discourse.codecombat.com/u/Giovanni_Busacca)\
**Post date:** [November 26, 2018, 3:26pm UTC](https://discourse.codecombat.com/t/the-wizards-door-bug/8269/8 "2018-11-26T15:26:04Z")

</div>

this is my code but when I submitted it the numbers changed and I failed the level please help me `# Move to ‘Laszlo’ and get his secret number.  
hero.moveXY(30, 13)  
las = hero.findNearestFriend().getSecret()

# Add 7 to 'Laszlo’s number to get 'Erzsebet’s number.

# Move to ‘Erzsebet’ and say her magic number.

erz = las + 7  
hero.moveXY(17, 26)  
hero.say(erz)

# Divide 'Erzsebet’s number by 4 to get 'Simonyi’s number.

# Go to ‘Simonyi’ and tell him his number.

hero.moveXY(30, 39)  
erz = las + -2.75  
hero.say(erz)

# Multiply 'Simonyi’s number by 'Laszlo’s to get 'Agata’s number.

# Go to ‘Agata’ and tell her her number.

hero.moveXY(43, 26)  
erz = las + 17.5  
hero.say(erz)`  
this was my code but the numbers changed

---

<div class="post-metadata">

**Author:** ![MunkeyShynes](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/munkeyshynes/32/9277_2.png) [@MunkeyShynes](https://discourse.codecombat.com/u/MunkeyShynes)\
**Post date:** [November 26, 2018, 4:18pm UTC](https://discourse.codecombat.com/t/the-wizards-door-bug/8269/9 "2018-11-26T16:18:34Z")

</div>

All of your calculations involve erz and laz. Where are the calculations for sim and aga? Also, you’re supposed to say sim and aga’s number when the comments tell you to, not just say erz all at every position.

Please learn to post your code properly. It’s really easy and only requires a very small amount of effort.

![FormatCode](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/0/03e091050fe4eed8c0076eee4ab979e171ba14c3.jpg)

To post your code **_from the game_** , use the **\</\>** button or it won’t format properly. When you click the **\</\>** button, the following will appear:

![PostCode](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/7/78430fb6ee8dec450c5a0355db89d0dc189030b4.JPG)

Please paste **ALL** of your code inside the triple back tick marks.

# ``` \<— Triple back tick marks.

**Paste ALL of your code in here.**

# ``` \<— Triple back tick marks.

There are many people here willing and able to help. If you use the **\</\>** button correctly, then **ALL** of your code should look like this:

```python
while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        hero.attack(enemy)
    else:
        hero.say("My code is formatted properly")

```

If **ALL** of your code isn’t formatted like the code above, then you’re doing it wrong and **_we can’t see the structure of the code_** to troubleshoot whether or not that is the issue. Use the **\</\>** button and **_help us help you_**. This works when sending a private message as well.

Thank you.
