Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- from pyrob.api import *
- def xxx():
- move_right()
- fill_cell()
- move_right()
- fill_cell()
- move_down()
- fill_cell()
- move_up()
- move_right()
- fill_cell()
- move_right()
- def yyy():
- move_down()
- fill_cell()
- move_down()
- fill_cell()
- move_left()
- fill_cell()
- move_right()
- move_down()
- fill_cell()
- move_down()
- def xxx2():
- move_left()
- fill_cell()
- move_left()
- fill_cell()
- move_up()
- fill_cell()
- move_down()
- move_left()
- fill_cell()
- move_left()
- def yyy2():
- move_up()
- fill_cell()
- move_up()
- fill_cell()
- move_right()
- fill_cell()
- move_left()
- move_up()
- fill_cell()
- move_up()
- def xm():
- a=0
- b=0
- c=0
- o=0
- while not wall_is_on_the_right():
- a+=1
- move_right()
- if a>=6:
- b=a-5
- b=b/2
- o=a
- while b>0:
- move_left(a)
- move_right(c+1)
- b-=1
- o=o-2
- for _ in range(o):
- fill_cell()
- move_right()
- for _ in range(o):
- fill_cell()
- move_right(c+1)
- move_down()
- c+=1
- else:
- move_left(a)
- move_right(c)
- xxx()
- else:
- move_left(a)
- xxx()
- def ym():
- d=0
- e=0
- f=0
- x=0
- while not wall_is_beneath():
- d+=1
- move_down()
- if d>=6:
- e=d-5
- e=e/2
- x=d
- while e>0:
- move_up(d)
- move_down(f+1)
- e-=1
- x=x-2
- for _ in range(x):
- fill_cell()
- move_down()
- for _ in range(x):
- fill_cell()
- move_down(f+1)
- move_left()
- f+=1
- else:
- move_up(d)
- move_down(f)
- yyy()
- else:
- move_up(d)
- yyy()
- def x2m():
- m=0
- h=0
- z=0
- v=0
- while not wall_is_on_the_left():
- m+=1
- move_left()
- if m>=6:
- h=m-5
- h=h/2
- v=m
- while h>0:
- move_right(m)
- move_left(z+1)
- h-=1
- v=v-2
- for _ in range(v):
- fill_cell()
- move_left()
- for _ in range(v):
- fill_cell()
- move_left(z+1)
- move_up()
- z+=1
- else:
- move_right(m)
- move_left(z)
- xxx2()
- else:
- move_right(m)
- xxx2()
- def y2m():
- j=0
- k=0
- l=0
- s=0
- while not wall_is_above():
- j+=1
- move_up()
- if j>=6:
- k=j-5
- k=k/2
- s=j
- while k>0:
- move_down(j)
- move_up(l+1)
- k-=1
- s=s-2
- for _ in range(s):
- fill_cell()
- move_up()
- for _ in range(s):
- fill_cell()
- move_up(l+1)
- move_right()
- l+=1
- else:
- move_down(j)
- move_up(l)
- yyy2()
- else:
- move_down(j)
- yyy2()
- @task
- def task_9_3():
- xm()
- while not wall_is_above():
- move_up()
- while not wall_is_on_the_right():
- move_right()
- ym()
- while not wall_is_on_the_right():
- move_right()
- while not wall_is_beneath():
- move_down()
- x2m()
- while not wall_is_beneath():
- move_down()
- while not wall_is_on_the_left():
- move_left()
- y2m()
- while not wall_is_on_the_left():
- move_left()
- while not wall_is_above():
- move_up()
- while not wall_is_on_the_right() and not wall_is_beneath():
- move_down()
- if __name__ == '__main__':
- run_tasks()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement