Always take an action inside a while loop, or it’ll go infinite!
Use while to loop until you have enough hits to kill 10 munchkins.
hits = 0
while hits < 10:
enemy = self.findNearestEnemy()
while hits >= 10:
This is my code. I can’t figure out why it won’t work. My character just keeps killing ogres and doesn’t ever retreat. Please help! Thanks!