-- 7 Billion Humans (2144) --
-- Level 62: The Sorting Floor --
-- Shortest Program: 44 Commands --
-- Fastest Program: 99 Seconds --
a:
if n != hole or
s == worker:
step n
jump a
endif
b:
pickup c
step s
step s
step s
drop
if s != hole:
step n
step n
jump b
endif
step w
mem3 = nearest worker
if w == hole:
c:
step n
if n != hole:
jump c
endif
d:
tell mem3 ok
listenfor ok
drop
if e != hole:
step e
else:
step sw
step w
endif
jump d
endif
e:
step n
listenfor ok
mem1 = set c
mem2 = foreachdir nw,w,sw,n,s,ne,e,se:
if mem2 <= mem1 or
mem1 == nothing:
mem1 = set mem2
endif
endfor
pickup mem1
giveto mem3
f:
step s
if s != hole:
jump f
endif
tell mem3 ok
if w == hole:
step e
endif
if e == hole:
step w
endif
jump e