7 BILLION HUMANS

Level 42: Important Email Organization

Shortest Program

-- 7 Billion Humans (2144) --
-- Level 42: Important Email Organization --
-- Shortest Program: 18 Commands --
mem3 = nearest wall
a:
if s != wall or
 w != wall:
    step nw,w,sw,s
    jump a
endif
mem4 = nearest shredder
b:
step mem3
mem1 = nearest datacube
step mem1
if c == datacube and
 s != shredder:
    pickup c
    step mem4
    mem1 = calc mem1 / 10
    c:
    if mem1 > 0:
        mem1 = calc mem1 - 1
        step e
        jump c
    endif
    giveto s
endif
jump b

Fastest Program

-- 7 Billion Humans (2144) --
-- Level 42: Important Email Organization --
-- Fastest Program: 162 Seconds --
a:
if s != wall or
 w != wall:
    step nw,w,sw,s
    jump a
endif
mem2 = nearest shredder
b:
step e
if se != wall:
    jump b
endif
mem3 = nearest shredder
c:
d:
step nw,n,ne
step nw,n,ne
step nw,n,ne
step nw,n,ne
step nw,n,ne
mem1 = nearest datacube
step mem1
if c != datacube or
 s == shredder:
    jump d
endif
pickup c
mem1 = calc mem1 / 10
if mem1 < 5:
    step mem2
    if mem1 >= 4:
        step e
    endif
    if mem1 >= 3:
        step e
    endif
    if mem1 >= 2:
        step e
    endif
    if mem1 >= 1:
        step e
    endif
else:
    step mem3
    if mem1 <= 8:
        step w
    endif
    if mem1 <= 7:
        step w
    endif
    if mem1 <= 6:
        step w
    endif
    if mem1 <= 5:
        step w
    endif
endif
giveto s
jump c
Back