Mad Maxer: Redemption glitch


#1

I’m working on Mad Maxer Redemption and have redone my code from Strikes Back. However, it keeps telling me that Cairin (an archer) should go home even though some villagers have less heath than her. Here’s my code:
``
loop:

weakest = None
leastHealth = 99999
friendIndex = 0
friends = self.findFriends()
while friendIndex < len(friends): 
    friend = friends[friendIndex]
    if friend.health < leastHealth:
        weakestFriend = friend
        leastHealth = friend.health
        self.say('Hey ' + weakestFriend.id + ', go home!')
   friendIndex = friendIndex + 1

``


#2

Please format your code according to the FAQ. Select all the code and hit this button:


#3

You have to use tab so the loop can work. This is Python. :wink::slight_smile::joy:


#4

You’ll have to make sure that archers are excluded.


#5

I’m pretty sure that this problem is already solved, so no need to revive dead threads here :slight_smile:


#6

Sorry, I saw April, didn’t see the year :blush:


#7

It’s okay, I make dumb mistakes too sometimes :blush::joy: