# Help plz hunters and prey

**URL:** <https://discourse.codecombat.com/t/help-plz-hunters-and-prey/33829>\
**Category:** Level Help\
**Created:** [September 15, 2022, 3:37pm UTC](https://discourse.codecombat.com/t/help-plz-hunters-and-prey/33829 "2022-09-15T15:37:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leonardo\_White](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/leonardo_white/32/27984_2.png) [@Leonardo\_White](https://discourse.codecombat.com/u/Leonardo_White)\
**Post date:** [September 15, 2022, 3:37pm UTC](https://discourse.codecombat.com/t/help-plz-hunters-and-prey/33829/1 "2022-09-15T15:37:30Z")

</div>

def pickUpCoin():  
# Collect coins.

```
pass

```

def summonTroops():  
# Summon soldiers if you have the gold.

```
pass

```

# This function has an argument named soldier.

# Arguments are like variables.

# The value of an argument is determined when the function is called.

def commandSoldier(soldier):  
# Soldiers should attack enemies.

```
pass

```

# Write a commandArcher function to tell your archers what to do!

# It should take one argument that will represent the archer passed to the function when it’s called.

# Archers should only attack enemies who are closer than 25 meters, otherwise, stay still.

while True:  
pickUpCoin()  
summonTroops()  
friends = hero.findFriends()  
for friend in friends:  
if friend.type == “soldier”:  
# This friend will be assigned to the variable soldier in commandSoldier  
commandSoldier(friend)  
elif friend.type == “archer”:  
# Be sure to command your archers.

```
        passd

```

```python
type or paste code here

```
