[SOLVED] I need help teachers


#1

Could you plz help me


#2

Here is my code to help me complete Blackwoods Forest : Blind Distance

Tell the wizard the distance to the coming ogres.

This function finds the nearest enemy and returns the distance to it.

If there is no enemy, the function returns 0.

def nearestEnemyDistance():
enemy = hero.findNearestEnemy()
result = 0
if enemy:
result = hero.distanceTo(enemy)
return result

while True:
# Call nearestEnemyDistance() and
# save the result in the variable enemyDistance.
enemyDistance = nearestEnemyDistance()
# If the enemyDistance is greater than 0:

    # Say the value of enemyDistance variable.

#3

Please format the code in FAQ format by using the triple brackets or by clicking the </> when you edit your post. It could be an indentation issue


#4

I believe you forgot a piece of code at the end. Make sure you check that enemyDistance is greater than 0. If so, say “enemyDistance


#5

i got that part but i have no idea what the next on is :cry:


#6

What do you mean next one? Make sure you do what I wrote first.


#7

i did do that but it still did not work


#9

oh i figuerd it out now i completed it


#10

Congrats. (20 Characters)


#11

thank you for helping me