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

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.


#12

Hey, i’m trying to complete Blind Distance, but i don’t know what to do. i tried looking at solutions for Blind Distance, but really couldn’t understand. plz help!


#13

Can someone help me, plz?


#14

There’s only two lines of code you need to write and the directions tell you what to do.
Start with the first line:

# If the enemyDistance is greater than 0:

Write this. Then, on the second line:

# Say the value of enemyDistance variable.

Write this and you’re done.


#15

those lines are already put in the coding i just need to know what to put below them


#16

We don’t provide solutions here. We assist you with learning by helping to troubleshoot your code. Simply providing solutions is counter productive to the learning process. There are many people here willing and able to assist you, but we do not just provide solutions.

As I stated before, there are just two lines of code you need to write and the commented hints tell you what to do. Have you tried anything at all? If so, please post your code and we’ll be happy to straighten out any problems. Remember to use the </> button so it formats properly.