Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

[SOLVED]CS2: Last Gauardian

I need help for combo challenge: Last Guardian computor science 2
For whatever reason my if else doesn’t work and it not telling me why so if you can help me or give me some of the code I’ll appreciate it

Hello and welcome to codecombat discourse! 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!

Hello and welcome to codecombat discourse, @shadaab_nexus! 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!

Plz post your code and format it. To format your code press the button!

can you post your code and format it using this button </>

Yes as @Dragonlouis @Dragonlouis welcome to the CodeCombat forum! Like they said check out the rules of the forum before you continue. Also before we can help you we need your code to be able to determine what is going on.

Thanks!

Hey! I’ve been active 23 days already!

Cool thats great~!!!

I’m not new! and you summoned me twice!

Luke meant he was welcoming that other person.

Ok so my code is on python
enemy = hero.findNearestEnemy()
If hero.isReady(“cleave”):
hero.cleave(enemy)
else:
hero.attack(enemy)

Yet when round start my hero cleaves the ogre then he doesn’t attack them and dies

use a while true loop and it should work

like this

while true:
enemy = hero.findNearestEnemy()
If hero.isReady(“cleave”):
hero.cleave(enemy)
else:
hero.attack(enemy)
2 Likes

@shadaab_nexus you need to format your code correctly.

@shadaab_nexus did this work?

He said tomorrow @Falcons118

tomorrow for what???

He’s done coding for the day @Falcons118

Yes thank you it worked

1 Like

For the true you need a capital.

mark whatever post helped the most as solved