Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Desert Combat: What is wrong with my code?


I don’t know what’s wrong with it. Help.

ordersGiven = 0
    enemy = self.findNearestEnemy()
    while ordersGiven < 5:
        x = self.pos.x
        y = self.pos.y - 10
        self.moveXY(x, y)
        ordersGiven = ordersGiven + 1
    while ordersGiven > 5:
        enemy = self.findNearestEnemy()
        if enemy:


which errors are there? and what is not working, please more detail…

problem is i think, that u have <5 and >5 but nothing to do if ordersgiven == 5 …
im not fluently in english but i think u should use a smaller as/bigger as