SaveText.Ru

1 (alt)
  1. def line():
  2.     while free_from_left():
  3.         move_left()
  4.     fill_cell()
  5.     while free_from_right():
  6.         move_right()
  7.         fill_cell()
  8. if free_from_up() and free_from_right() and free_from_left() and free_from_down():
  9.     move_down()
  10.     if free_from_down():
  11.         move_down()
  12.         line()
  13.         move_up()
  14.         move_up()
  15.         line()
  16.         for a in range(2):
  17.             move_up()
  18.         line()
  19.     else:
  20.         for c in range(3):
  21.             line()
  22.             move_up()
  23.             move_up()
  24.         line()
  25. elif wall_from_up() and wall_from_right() and free_from_down():
  26.     for b in range(3):
  27.         line()
  28.         move_down()
  29.         move_down()
  30.     line()
  31. elif wall_from_down() and free_from_up() and free_from_right():
  32.     line()
  33. elif wall_from_up() and wall_from_right() and wall_from_left():
  34.     fill_cell()
  35. elif wall_from_left() and free_from_down():
  36.     move_up()
  37.     fill_cell()
  38.     move_up()
  39.     move_up()
  40.     fill_cell()
  41.     while free_from_down():
  42.         move_down()
  43.     fill_cell()
  44.     move_up()
  45.     move_up()
  46.     fill_cell()

Share with your friends:

Print