Fix condition_goal_reached() and condition_on_apple()

master
BodgeMaster 2022-11-06 03:30:03 +01:00
parent cf311ae3fa
commit 5f6990050b
1 changed files with 4 additions and 4 deletions

View File

@ -112,13 +112,13 @@ def condition_in_front_of_wall(inverted):
def condition_goal_reached(inverted): def condition_goal_reached(inverted):
if inverted: if inverted:
return not field[cursor_position[1]][cursor_position[2]]==goal return not field[cursor_position[1]][cursor_position[0]]==goal
return field[cursor_position[1]][cursor_position[2]]==goal return field[cursor_position[1]][cursor_position[0]]==goal
def condition_on_apple(inverted): def condition_on_apple(inverted):
if inverted: if inverted:
return not field[cursor_position[1]][cursor_position[2]]==apple return not field[cursor_position[1]][cursor_position[0]]==apple
return field[cursor_position[1]][cursor_position[2]]==apple return field[cursor_position[1]][cursor_position[0]]==apple
# return value: "" or error message # return value: "" or error message
def command_step(): def command_step():