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

Clash of clones please help

plz help i realy need it

i don’t have any code

I’m stuck too

<div data-theme="foo">

[en_US.composer.my_button_text]

</div>

Before I help you I want to know that you’ve at least tried. You could just try attacking the enemy, using flags, using special abilities…
Once you’ve both done that, you can post your code and I’ll help you.
Danny

I have code, several chunks of it, none of them work though, at the moment all I have is this

while true:
    enemy = hero.findnearestenemy()
    hero.attack(enemy)

26%20PM

I think the best advice I can give you is to use all the special abilities you can. Why use simple sword? It doesn’t have an ability. You could you the ‘cleave’ sword instead. I also recommend the invisibility ring and the emperor’s gloves (this is the most important, except of the cleave sword).
You should also try and kill the archers first. (“jump”, then “cleave”?)
This is a good strategy, but you should also try and think some stuff up for yourself, or there isn’t much point.
Danny

34%20AM

you could use your emperor’s gloves to cast chain-lightning on the archers

Also use the cleave sword, it will definitely help. I also don’t recommend having the runesword anyway, once you have enough gems I’d buy the sword of the temple guard/ sword of the forgotten.

just a question does anybody have a WT:social account because i made a topic for codecombat

I have working code, sort of. It does everything but attacks a sand yak at the end

# You'll need good strategy to win this one!
# Your clone will have the same equipment you have!
# But, they're not very skilled at using special powers.
enemy = hero.findNearestEnemy()
if enemy.type not sand-yak:
    hero.cast("chain-lightning", target)
while True:
    enemy = hero.findNearestEnemy()
    hero.attack(enemy)
    if hero.health == 50:
        hero.moveXY(54, 64)
        break

22%20AM

Since your enemy.type check is before the while loop, it only looks once. Every other time, the sand-yak is a possible enemy. Add that check before your hero.attack with an if enemy:.

This is the line creating your error. It needs “is not” and sand-yak needs to be in quotes.

if enemy and enemy.type is not "sand-yak":  # or "!=" instead of "is not"

Also, you haven’t declared the variable target when you cast the spell.

enemy = hero.findNearestEnemy()
if enemy.type not sand-yak:
    hero.cast("chain-lightning", target)  # target is not defined, will create an error

One last thing, checking your hero health with an absolute equal value will not likely be captured. Switch that to less than. Keep in mind that after your break, you are counting on your friends to complete the level without your help and you aren’t defending yourself either.