Well… I was playing with Phyton but I can’t beat this level.

I don’t know what’s wrong, so I hope you can help me <3

Here’s my code:

def commandPeasant(peasant, coins):

# Command the peasant to the nearest of their array

distance = 0

for i in coins:

coin = coins[i]

if distance == 0:

distance = peasant.distanceTo(coin)

item = coin

elif distance < peasant.distanceTo(coin):

distance = peasant.distanceTo(coin)

item = coin`hero.command(peasant, "move", item.pos)`

friends = hero.findFriends()

peasants = {

“Aurum”: friends[0],

“Argentum”: friends[1],

“Cuprum”: friends[2]

}

while True:

items = hero.findItems()

goldCoins = []

silverCoins = []

bronzeCoins = []

for item in items:

if item.value == 3:

goldCoins.append(item)

# Put bronze and silver coins in their approriate array:

if item.value == 2:

silverCoins.append(item)

if item.value == 1:

bronzeCoins.append(item)

commandPeasant(friends[0], goldCoins)

commandPeasant(friends[1], silverCoins)

commandPeasant(friends[2], bronzeCoins)