TOIL AND TROUBLE in the mountain

At one point while codinng, I made a mistake (guess I was tired) but it succeeded, and after fixing it, it no longer did work.

Here’s the wrong code (even with error) that made me win, while code that made the archers correctly target their closest enemy and the soldiers target the closest witch failed terrible (due to area of attack damage, I’m guessing). The final version after reading these posts (i.e. using their vision, not the hero’s) and splitting the soldiers worked like a charm too I just thought it was interesting that the below code worked at all, given that “enemies” is never defined. :smiley:

[code removed as it does give a solution]

Any thoughts on why this is still working? is it because both use target and thus the archer’s definition of the enemy is used for the command?


I resisted reviving this and this - and still got the “really revive?” message on this one… Is it preferable to open a new one, or given that it’s all about the same level, write in an old thread?