Clash of Clones - Is it possible to win?


#21

I did the same thing as you guys but still couldn’t beat it! what am I doing rong??? :cry: I also tried using other types of armor like: painted steel helmet, obsidian breast plate, and steel striker


#22

We need your code if you want us to help you


I need help with "Wild Horses" Python version
#23

Ahh i had a very complex 70 line code while figuring out how to make it with a warrior. It was a mix of jumping and opponent selection. Removing primary weapon made it easy with a 15 line code :smile:


#24

I am so angry i just thought litterally to do the stupidest code and it worked, everybody think inside the box, i wont give it away but it is super easy, I beat it in 6 lines, only attacked once :smile:


#27

I tried this method out, and it worked out nicely. Though, I plan on going back to see if I can find another way to do it eventually.


#28

hey,dude, would you please up load your code?

it’s hard for me to pass this level,

you are so clever!


#29

Done exactly the same thing, spend like 3h to write my code and NPC still beaten me badly (163 lines with functions - enemy grouping, updating lists, finding furthest archer or lowest HP soldier, different attack style for every type etc.)

Removed primary weapon and code worked like a charm, bashed them :smiley:


#30
loop:
    enemy = self.findNearest(self.findEnemies())
    #if its the first 10s, dont attack
    if self.now() < 10:
        pass
    #after 10s find and attack all enemies except yaks
    else:
        if enemy:
            if enemy.type != "sand-yak":
                while enemy.health > 0:
                    self.bash(enemy)
      #if no enemy is found, pass
      elif not enemy:
          pass

Hi im new here can you please help me with my code by kindly pointing out the mistakes im making.
When i run the code it says that the code is either too slow or an infinite loop. Why does it say so?


#31

It is probably your:

            if enemy.type != "sand-yak":
                while enemy.health > 0:
                    self.bash(enemy)

you can’t “bash” that often, so either it will hang because you can’t bash (yet) or bash-fail billions of times until you can . . . either way the program would get stuck there.

The fix for the first would be to wrap the “bash” in a check to see if you are ready to bash

            if enemy.type != "sand-yak":
                while enemy.health > 0:
                    if self.isReady("bash"):
                        self.bash(enemy)

But this would cause the second problem (cycling billions of time until ready)

So the solution is to NOT bash while enemy not dead, but bash once per “loop”…

            if enemy.type != "sand-yak":
                if self.isReady("bash"):
                    self.bash(enemy)

OR as long as “bash” is the only thing you do inside the if not sand-yak:

            if enemy.type != "sand-yak" and self.isReady("bash"):
                self.bash(enemy)

You should always wrap an action where the “Cooldown” is longer than it “Takes” in an isReady("…") check.


#32

Thanks alot man i did what you said and it worked!
Finally i understand what i was doing wrong all this time
Thanks again! :smile:


#33

This challenge took me a while to complete. I was using a ranged character with the highest DPS ranged weapon I had access to. So I was killing the enemy troops in a single shot, but so was my doppelganger.

I tried equipping a weaker weapon with scattershot, and also using throw. I kept accidentally hitting a Yak!
I tried switching to Anya, using a cleave sword with bash also. But just kept getting overwhelmed.
I tried attacking the doppelganger first, this also failed because I would be on the front line and draw fire from all the enemy troops.

Finally I ended up buying the Sparkbomb, which is a throw item for the ranged characters. It does 329 aoe damage. So it wiped out half the enemy troops and the Doppelganger with a single use :smile:

So if you are having a rough time, just buy the Sparkbomb and celebrate!


#34

Man, this level is so easy. Use warrior, with no primary weapon. All you need after that is to bring a shield that can bash, and you need lots of health (I had 1277).


#35

Please don’t post correct code. This makes things too easy for others. For posting code in the future, please format it as specified in the FAQ. Thanks!


#36

Yeah, having high HP is what I didn’t have when I tried the same technique as you. I had around 750 I believe, and it didn’t go so well!


#37

sorry for posting code, gundericus. If you want high health, get a worn dragonscale helm. Its cheap and it gives around 500 health.


#38

How?
like how did you do this i keep dieing with your code


#39

Your question is a “bit” vague. I suggest you read through the topic, and other related topics – there should be enough hints in those to successfully finish the level.

Cheers


#40

thanks man because i have better armor than the stuff iv seen on this topic


#41

I bet the level by doing the following.

[redacted, we do not post correct code]


#42

Please don’t post correct code. It takes away the whole point of the level.