Need help with Brave Ogres (Python)

This is what I have so far
while True:
nearestenemy = hero.findNearestEnemy()
enemy = hero.distanceTo(hero.findNearestEnemy())
if enemy < :
hero.cleave(enemy)
else:
hero.attack(‘Door’)
I still don’t know what I am doing exactly so any help would be appreciated

if enemy < #<--add a five right here:
# add if hero.isReady(“cleave”):
    hero.cleave(enemy)
1 Like

Hello and welcome to codecombat discourse @bladee! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review this topic, which shows all essentials of this board! Thanks! And also make sure to send a link to the level so others can get to the level faster if possible.

you have to keep this line in an if like this then it will find the distance

if nearestenemy:
    enemy = hero.distanceTo(nearestenemy)

hey im pretty sure this guy is not active anymore so please dont reply to him

2 Likes

ok @cheddarcheese (20chars)