Backwoods standoff if else

On Backwoods standoff, I believe I am doing it right but it keeps telling me to add a ‘:’ What do I do? Code:
while True:
enemy = hero.findNearestEnemy()
# Use an if-statement with isReady to check “cleave”:
if “cleave” hero.isReady: {THIS IS WHERE IT SAYS I AM WRONG. This side note is not in the code}
hero.cleave(enemy)
# Cleave!
# Else, if cleave is not ready:
else:
hero.attack(enemy)
hero.attack(enemy)
# Attack the nearest ogre!

Next time try to preformat your code according to the FAQ
https://discourse.codecombat.com/faq
Also it is not if "cleave" hero.isReady: but it is if hero.isReady("cleave"):

1 Like

Thanks for the feedback!


was this the intended usage?
else wouldn’t work

I just used thornpick. It was so easy.

Look at your methods to see the proper use/format for is.Ready(action). Everything you need to know is there. Get in the habit of looking at these methods. You’re going to need to refer to this quite often.

you need to do if hero.isReady("cleave") for it to work.


muahahaha

with thornprick!(20)

my code looks just like that but hero wont attack indeviduals just cleave

If your code is “just like that” then it’s wrong. As I stated above, look at the methods listed in the middle of the screen to see the proper format and use. Everything you need to know is there. Get in the habit of looking at these methods. You’re going to need to refer to this quite often.