Help! Blind Distance


#1

Help!!! I can’t pass Blind Distance because it says "Cannot read property ‘start’ of undefined"
My code is


#2

Can I see your code it’s a bit hard to see the code in the picture.


#3

Hi! Your code is very close to victory, but 17th line is problem one. Don’t want to offend you, but looks like you don’t understand meaning and purpose of functions and variables) Try to renew you knowledge about this stuff, and then work over 17th line: replace some parts or some kind of this… Good luck!


#4

@Numyevenodd_Gaming

Variables store data the following way:

Storage = Value

So when you are writing code make sure that the storage is always on the left of the " = "


#5

Omg, I totally didn’t notice! Thanks so much!!!


#6

Need help!

I do not know my problem but the distance is greater than 0 is my problem, that’s all I can say.


#7

It’s a bug for all I know I have the best glasses in the game and it still doesn’t work what I did is

while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        distance = hero.distanceTo(enemy)
        if distance <= 10:
            hero.say("10")


#8

What is distance in your code? You save the result to enemyDistance.

Nope, it’s a problem with the solution :slight_smile:


#9

Oh found that.
20 characters


#10

So, how would I fix it? I been stuck on that level forever.


#11

Use the real variable with a value. You haven’t defined the variable distance, only enemyDistance. I suppose you should revise some early levels about variables.