Uneasy truce (pyton) hlp [Solved]

what do i put at the bottom of the code? and thanks for everyone who helps @AnSeDra @dedreous @Deadpool198

# Summon one soldier for every ogre to the south of you!
# Don't count the ogres to the north!

# Accept an array of units as the parameter.
# Return only the units to the south of the hero.
def findSouthernUnits(units):
    southernUnits = []
    for unit in units:
        if unit.pos.y < hero.pos.y:
            # Add the unit to the array with: append()
            southernUnits.append(unit)
    return southernUnits


while True:
    friends = hero.findFriends()
    enemies = hero.findEnemies()
    # Use findSouthernUnits to get enemies to the south.
    findSouthernUnits(unit)
    # If there are more ogres south of you than friends.
    
        # Then summon another "soldier".
        
4 Likes

Where did you declare the array unit?

Andrei

3 Likes

You have to put something other than ‘units’ in the parentheses, and you also need to summon soldiers.

3 Likes

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.