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

[Desert Combat] Stuck in a while loop?


I’ve tried a few different things on the second while loop. I keep getting the same error message.


I think it’s because of the returning value of findNearestEnemy.

Try something like this:

while ordersGiven>=5:
    #it should not ignore this check
    if enemy:


That didn’t work. I’m not sure what to do.


Outlash forgot some brackets.
Correct is

enemy = self.findNearestEnemy()