This is weird, I can’t beat ice-life.
My code is(yes, its the best I could think of)
# You can define the inner field.
# 1 is a peasant, 0 is an empty cell.
innerField = [
[1,1,1,0,0,0,0,0,0,0],
[0,0,1,0,0,0,0,0,0,0],
[0,1,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0],
[1,1,1,0,0,0,0,0,1,0],
[0,0,1,0,0,0,0,1,0,0],
[0,1,0,0,0,0,0,1,1,1]
]
while True:
hero.findNearestEnemy().initField(innerField)
# It's to avoid infinity loop problem.
hero.wait(1)