-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask_22.py
More file actions
36 lines (29 loc) · 735 Bytes
/
task_22.py
File metadata and controls
36 lines (29 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/python3
from pyrob.api import *
@task
def task_5_10():
left=True
fill_cell()
while not wall_is_on_the_right():
move_right()
fill_cell()
flag1= not wall_is_beneath()
while flag1:
move_down()
fill_cell()
flag2=True
while flag2:
if left:
move_left()
fill_cell()
else:
move_right()
fill_cell()
flag2=not (wall_is_on_the_right() or wall_is_on_the_left())
left=wall_is_on_the_right()
flag1 = not wall_is_beneath()
if left:
while not wall_is_on_the_left():
move_left()
if __name__ == '__main__':
run_tasks()