Hi, I am on grid-search-Level.
I don’t understand why my code works with hero.moveXY(x,y)
and it does not with
pos = {'x': x , 'y': y} hero.move(pos)
Here is the whole code:
leftBorder = 20
rightBorder = 61
bottomBorder = 20
topBorder = 51
step = 10
# Iterate X coordinates from the left to right border with step 10.
for x in range(leftBorder, rightBorder, step):
# Use a nested loop to iterate through Y coordinates for each X.
# Iterate y coordinates from the bottom to top border with step 10.
for y in range(bottomBorder, topBorder, step):
# Move to the point with coordinates X, Y and say anything.
hero.moveXY(x,y)
#does not work
#pos = {'x': x , 'y': y}
#hero.move(pos)
hero.say("I move to "+ x+ " "+y)
pass
# Allow peasants to check the last point.
hero.moveXY(20, 10)