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

The Agrippa Defense: Code Doesn't Work


I have been stuck on this level for several days. I have even visited several of the tutorials on YouTube, and their code is exactly the same. Except, their code worked, and mine doesn’t. Can someone help me please? This is what my code looks like:

while True:
enemy = hero.findNearestEnemy()
if enemy:
pass # Replace this with your own code.
# Find the distance to the enemy with distanceTo.
distance = hero.distanceTo(enemy)
# If the distance is less than 5 meters…
if distance < 5:
# … if “cleave” is ready, cleave!
if hero.isReady(“cleave”):
# … else, just attack.

this is the link to the video that has the same code as me:



@Aubrey_Lynn The code seems to work for me. Can you use the code formatter to show us the tabs on the code. In python if the tab spacing is off it will cause different things to happen.

Click on the "Preformatted text button after highlighting your code: