SaveText.Ru

3
  1. if wall_from_left() and free_from_down():
  2.     move_down()
  3. elif wall_from_up() and free_from_left():
  4.     move_left()
  5. elif free_from_left() and free_from_up():
  6.     move_up()
  7. elif free_from_right () and wall_from_left():
  8.     move_right()
  9. elif free_from_up() and free_from_left():
  10.     move_up()
  11. elif wall_from_right() and wall_from_up():
  12.     move_left()

Share with your friends:

Print