if wall_from_up() and free_from_right():
move_right()
if free_from_up() and free_from_right():
fill_cell()
move_right()
fill_cell()
if wall_from_up() and free_from_right():
move_right()
if wall_from_up() and free_from_right():
move_right()
if free_from_up() and free_from_right():
move_up()
if cell_is_filled() and not cell_is_clean():
move_down()
fill_cell()
move_right()
fill_cell()
move_right()
else:
if cell_is_clean():
move_down()
move_right()
fill_cell()
move_right()
Сам спросил, сам и ответил.