hm your is different to mine this is the first part of it idk if I can post it cause it said no solutions but this is just part of one so I’ll delete this if its not allowed
def commandPeasant(peasant, coins):
# Command the peasant to find the nearest of their coins array:
item = peasant.findNearest(coins)
if item:
hero.command(peasant, "move", item.pos)