# Grim determination solved

My griffin riders dont attack and my hero summons only one and my peasants just walk into each other and do nothing but try and walk into each other

``````  # Your goal is to protect Reynaldo

# Find the paladin with the lowest health.
lowestHealth = 99999
lowestFriend = None
friends = self.findFriends()
for friend in friends:
continue
if friend.health < lowestHealth and friend.health < friend.maxHealth:
lowestHealth = friend.health
lowestFriend = friend

return lowestFriend

else:

def commandFriends():
friends = self.findFriends()
for friend in friends:
if friend.type == "peasant":
commandPeasant(friend)
elif friend.type == "griffin-rider":
commandGriffin(friend)
def commandGriffin(griffin):
enemy = griffin.findNearest(griffin.findEnemies())
self.command(griffin, "attack", enemy)

def commandPeasant(peasant):
coin = peasant.findNearest(peasant.findItems())
self.command(peasant, "move", coin.pos)

loop:
commandFriends()
# Summon griffin riders!
self.summon("griffin-rider")``````

i beat it so it is solved

can you help me? I just don’t get it.Branches confuse me.here’s my code:

# Find the paladin with the lowest health.

lowestHealth = 99999
lowestFriend = None
friends = self.findFriends()
for friend in friends:
continue
if friend.health < lowestHealth and friend.health < friend.maxHealth:
lowestHealth = friend.health
lowestFriend = friend

``````return lowestFriend
``````

# And don’t forget, they can attack, too!
else:

def commandFriends():
friends = self.findFriends()
for friend in friends:
if friend.type == “peasant”:
commandPeasant(friend)
elif friend.type == “griffin-rider”:
commandGriffin(friend)