Here is my code:
# If you lose, you must wait a day to re-submit. # Each time you submit gives a new random seed. def commandSoldiers(nearest): for friend in self.findFriends(): if friend and nearest: self.command(friend, "attack", nearest) loop: if item: self.move(item.pos) nearest = self.findNearest(self.findEnemies()) if nearest: if self.isReady("chain-lightning"): self.cast("chain-lightning", nearest) if self.isReady("cleave"): self.cleave(nearest) self.attack(nearest) item = self.findNearest(self.findItems()) if item: self.move(item.pos) if self.gold>=20: self.summon("soldier") commandSoldiers(nearest)
When I run it, my soldiers don’t attack! The only reason I can think of for my soldiers not attacking is that commandSoldiers does not work. Can anybody tell me why?
Note:This isuue happens with every replayable level.