SaveText.Ru

324
  1. def fill():
  2.     fill_cell()
  3.     if wall_from_right():
  4.         while free_from_left():
  5.             move_left()
  6.             fill_cell()
  7.     if wall_from_left():
  8.         while free_from_right():
  9.             move_right()
  10.             fill_cell()
  11. if free_from_down() and free_from_left() and free_from_right() and free_from_up():
  12.     while free_from_right():
  13.         move_right()
  14.     fill()
  15.     for xvideos in range(3):
  16.         move_down()
  17.         fill()
  18.     move_down()
  19.     fill()
  20. elif wall_from_right() and free_from_left() and free_from_up():
  21.     fill()
  22.     move_up()
  23.     fill()
  24.     move_down()
  25.     move_down()
  26.     fill()
  27. elif wall_from_up() and wall_from_left():
  28.     move_down()
  29.     fill()

Share with your friends:

Print