SaveText.Ru

5
  1. if wall_from_up() and free_from_down():
  2.     move_down()
  3.     if free_from_right() and free_from_left():
  4.         move_right()
  5.         move_right()
  6. elif wall_from_down() and free_from_up():
  7.     move_up()
  8.     move_up()
  9.     move_right()
  10.     move_right()
  11. elif wall_from_left() and free_from_right():
  12.     move_right()
  13.     move_right()
  14.     move_right()
  15.     move_right()
  16. elif free_from_left() and wall_from_right() and wall_from_up():
  17.     move_left()
  18.     move_right()
  19. elif wall_from_down() and wall_from_up():
  20.     move_right()
  21. elif free_from_right() and free_from_left():
  22.     move_right()
  23.     move_right()
  24. elif free_from_left() and wall_from_right():
  25.     move_left()
  26.     move_right()
  27. elif wall_from_left() and free_from_up() and wall_from_right():
  28.     move_down()
  29.     if wall_from_down():
  30.         move_up()
  31.         move_up()
  32.         move_right()
  33.         move_right()
  34.     else:
  35.         move_right()
  36.         move_right()
  37. if wall_from_left() and wall_from_right():
  38.     move_down()
  39.     move_right()
  40.     move_right()

Share with your friends:

Print