SaveText.Ru

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

Share with your friends:

Print