I’m on the “Brittle Morale” level in the Sarven Desert thing. Even though I’m sure the code will work, it just keeps bringing this stupid error: “Attempt to invoke bookmark for [Function]”. I’ve checked another topic about this issue, but it doesn’t help at all.
Here’s my code (I’m using Python):
def findStrongestEnemy(enemies): strongest = None strongestHealth = 0 enemyIndex = 0 # While enemyIndex is less than the length of enemies: while enemyIndex < len(enemies): # Set an enemy variable to enemies[enemyIndex] enemy = enemyIndex[enemies] # If enemy.health is greater than strongestHealth if enemy.health > strongest.health: # Set strongest to enemy strongest = enemy # Set strongestHealth to enemy.health strongestHealth = enemy.health # Increment enemyIndex enemyIndex += 1 return strongest enemies = hero.findEnemies() leader = findStrongestEnemy(enemies) hero.say(leader)