# How do I complete Clash of Clones?

**URL:** <https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767>\
**Category:** Level Help\
**Created:** [March 1, 2017, 6:42pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767 "2017-03-01T18:42:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![PrincessPandaCode](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/princesspandacode/32/5978_2.png) [@PrincessPandaCode](https://discourse.codecombat.com/u/PrincessPandaCode)\
**Post date:** [March 1, 2017, 6:42pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/1 "2017-03-01T18:42:07Z")

</div>

This code kills all of the clones, but the hero dies just before the last of ogres are killed.

```python
while True:
    Badniks = hero.findEnemies()
    EggPawns = hero.findByType("archer", Badniks)
    SonicAndCo = hero.findFriends()
    RobotIndex = 0
    while RobotIndex < len(EggPawns):
        Badnik = EggPawns[RobotIndex]
        if hero.distanceTo(Badnik) < 37:
            while Badnik.health > 0:
                if hero.isReady("bash"):
                    hero.bash(Badnik)
                else:
                    hero.attack(Badnik)
        RobotIndex += 1
    RobotIndex = 0
    while RobotIndex < len(Badniks):
        Badnik = Badniks[RobotIndex]
        if Badnik.type != "sand-yak" and hero.distanceTo(Badnik) < 37:
            if not hero.health < 10:
                while Badnik.health > 0:
                    if hero.isReady("bash"):
                        hero.bash(Badnik)
                    else:
                        hero.attack(Badnik)
            elif len(SonicAndCo) > 6:
                hero.shield()
            else:
                while Badnik.health > 0:
                    if hero.isReady("bash"):
                        hero.bash(Badnik)
                    else:
                        hero.attack(Badnik)
        RobotIndex += 1

```

_Yes, I’m a Sonic fan._

I only have 106 diamonds left.

---

<div class="post-metadata">

**Author:** ![Luke10](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/luke10/32/19892_2.png) [@Luke10](https://discourse.codecombat.com/u/Luke10)\
**Post date:** [March 1, 2017, 6:57pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/2 "2017-03-01T18:57:59Z")

</div>

> [@PrincessPandaCode](#):
>
> RobotIndex +=

> [@PrincessPandaCode](#):
>
> if Badnik.type !

Was the += and the ! supposed to be there? Also could you send a screenshot?

---

<div class="post-metadata">

**Author:** ![PrincessPandaCode](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/princesspandacode/32/5978_2.png) [@PrincessPandaCode](https://discourse.codecombat.com/u/PrincessPandaCode)\
**Post date:** [March 2, 2017, 3:15pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/3 "2017-03-02T15:15:50Z")

</div>

![](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/a/a73986e6eb63ed33652bf3d489553d74bc6aa5b6.png)

---

<div class="post-metadata">

**Author:** ![Luke10](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/luke10/32/19892_2.png) [@Luke10](https://discourse.codecombat.com/u/Luke10)\
**Post date:** [March 2, 2017, 3:18pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/4 "2017-03-02T15:18:30Z")

</div>

Is it giving you any errors in the game? You also may not have the right equipment

---

<div class="post-metadata">

**Author:** ![Luke10](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/luke10/32/19892_2.png) [@Luke10](https://discourse.codecombat.com/u/Luke10)\
**Post date:** [March 2, 2017, 3:19pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/5 "2017-03-02T15:19:47Z")

</div>

Try some better armor…

---

<div class="post-metadata">

**Author:** ![PrincessPandaCode](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/princesspandacode/32/5978_2.png) [@PrincessPandaCode](https://discourse.codecombat.com/u/PrincessPandaCode)\
**Post date:** [March 2, 2017, 5:54pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/6 "2017-03-02T17:54:55Z")

</div>

No seriously, I have 106 diamonds left. I can’t buy any better armor at this point.

And there are no errors.

---

<div class="post-metadata">

**Author:** ![Luke10](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/luke10/32/19892_2.png) [@Luke10](https://discourse.codecombat.com/u/Luke10)\
**Post date:** [March 2, 2017, 6:50pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/7 "2017-03-02T18:50:54Z")

</div>

> [@PrincessPandaCode](#):
>
> I have 106 diamonds left.

Pay the subscription then it should give you 2,000 gems…it’s $9.99

---

<div class="post-metadata">

**Author:** ![PrincessPandaCode](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/princesspandacode/32/5978_2.png) [@PrincessPandaCode](https://discourse.codecombat.com/u/PrincessPandaCode)\
**Post date:** [March 2, 2017, 11:04pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/8 "2017-03-02T23:04:00Z")

</div>

No, I’m not gonna pay real money for some extra currency in a game! I went on Codecombat just to enjoy coding, not to pay some bucks!

And, I have 518 diamonds now thanks to some brawl levels.

---

<div class="post-metadata">

**Author:** ![Luke10](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/luke10/32/19892_2.png) [@Luke10](https://discourse.codecombat.com/u/Luke10)\
**Post date:** [March 3, 2017, 1:02am UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/9 "2017-03-03T01:02:47Z")

</div>

Okay, do you play with a free account?

---

<div class="post-metadata">

**Author:** ![PrincessPandaCode](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/princesspandacode/32/5978_2.png) [@PrincessPandaCode](https://discourse.codecombat.com/u/PrincessPandaCode)\
**Post date:** [March 3, 2017, 5:56pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/10 "2017-03-03T17:56:23Z")

</div>

Yes, I do play with a free account.

---

<div class="post-metadata">

**Author:** ![juraj\_pechac](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/juraj_pechac/32/4987_2.png) [@juraj\_pechac](https://discourse.codecombat.com/u/juraj_pechac)\
**Post date:** [March 3, 2017, 7:44pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/11 "2017-03-03T19:44:26Z")

</div>

Your **clone** will have **the same equipment** you have!  
But, they’re **not** very skilled at **using special powers**.  
=\> use special powers and you win

---

<div class="post-metadata">

**Author:** ![\_TD\_RodYT](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/_td_rodyt/32/6285_2.png) [@\_TD\_RodYT](https://discourse.codecombat.com/u/_TD_RodYT)\
**Post date:** [March 3, 2017, 9:40pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/12 "2017-03-03T21:40:59Z")

</div>

That’s why I always have a couple thousand diamonds in my inventory. I save up to purchase the best armor in the game like the Deflector

---

<div class="post-metadata">

**Author:** ![PrincessPandaCode](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/princesspandacode/32/5978_2.png) [@PrincessPandaCode](https://discourse.codecombat.com/u/PrincessPandaCode)\
**Post date:** [March 6, 2017, 3:19pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/13 "2017-03-06T15:19:05Z")

</div>

No need for suggestions anymore. I defeated the clone army already by moving away from the enemies when the health is low.

---

<div class="post-metadata">

**Author:** ![\_TD\_RodYT](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/_td_rodyt/32/6285_2.png) [@\_TD\_RodYT](https://discourse.codecombat.com/u/_TD_RodYT)\
**Post date:** [March 6, 2017, 4:16pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/14 "2017-03-06T16:16:20Z")

</div>

Congratulations! Its a tough level!

---

<div class="post-metadata">

**Author:** ![Ry4n\_17](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ry4n_17/32/11794_2.png) [@Ry4n\_17](https://discourse.codecombat.com/u/Ry4n_17)\
**Post date:** [August 25, 2019, 5:40pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/15 "2019-08-25T17:40:37Z")

</div>

can you pass the code

---

<div class="post-metadata">

**Author:** ![Luke10](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/luke10/32/19892_2.png) [@Luke10](https://discourse.codecombat.com/u/Luke10)\
**Post date:** [August 26, 2019, 4:09pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/16 "2019-08-26T16:09:59Z")

</div>

No solutions like giving the code are allowed on the forum. Codecombat was created to teach people how to code. Please post your code with a description and we will try our best to help you

---

<div class="post-metadata">

**Author:** ![Ry4n\_17](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ry4n_17/32/11794_2.png) [@Ry4n\_17](https://discourse.codecombat.com/u/Ry4n_17)\
**Post date:** [September 2, 2019, 11:18pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/17 "2019-09-02T23:18:03Z")

</div>

while True:  
Badniks = hero.findEnemies()  
EggPawns = hero.findByType(“archer”, Badniks)  
SonicAndCo = hero.findFriends()  
RobotIndex = 0  
while RobotIndex \< len(EggPawns):  
Badnik = EggPawns[RobotIndex]  
if hero.distanceTo(Badnik) \< 37:  
while Badnik.health \> 0:  
if hero.isReady(“bash”):  
hero.bash(Badnik)  
else:  
hero.attack(Badnik)  
RobotIndex += 1  
RobotIndex = 0  
while RobotIndex \< len(Badniks):  
Badnik = Badniks[RobotIndex]  
if Badnik.type != “sand-yak” and hero.distanceTo(Badnik) \< 37:  
if not hero.health \< 10:  
while Badnik.health \> 0:  
if hero.isReady(“bash”):  
hero.bash(Badnik)  
else:  
hero.attack(Badnik)  
elif len(SonicAndCo) \> 6:  
hero.shield()  
else:  
while Badnik.health \> 0:  
if hero.isReady(“bash”):  
hero.bash(Badnik)  
else:  
hero.attack(Badnik)  
RobotIndex += 1

---

<div class="post-metadata">

**Author:** ![Ry4n\_17](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ry4n_17/32/11794_2.png) [@Ry4n\_17](https://discourse.codecombat.com/u/Ry4n_17)\
**Post date:** [September 2, 2019, 11:35pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/18 "2019-09-02T23:35:11Z")

</div>

can you give an example of special powers 🙂

---

<div class="post-metadata">

**Author:** ![Finnian\_Weiland](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/finnian_weiland/32/10976_2.png) [@Finnian\_Weiland](https://discourse.codecombat.com/u/Finnian_Weiland)\
**Post date:** [November 13, 2019, 10:56pm UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/19 "2019-11-13T22:56:39Z")

</div>

can you please give me some help

---

<div class="post-metadata">

**Author:** ![Deadpool198](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/deadpool198/32/16753_2.png) [@Deadpool198](https://discourse.codecombat.com/u/Deadpool198)\
**Post date:** [November 14, 2019, 10:37am UTC](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767/20 "2019-11-14T10:37:10Z")

</div>

Hi, if you need help with your code, post it formatted and tell me what your problems are.  
Danny

[Next page](https://discourse.codecombat.com/t/how-do-i-complete-clash-of-clones/10767.md?page=2)
