-- 7 Billion Humans (2144) --
-- Level 52: The Mode Code --
-- Shortest Program: 24 Commands --
-- Fastest Program: 152 Seconds --
mem4 = set s
a:
step w
if w != nothing:
mem1 = calc mem1 + 1
jump a
endif
step n
b:
if n == datacube:
step n
c:
if c == mem1:
mem3 = calc mem3 + 1
endif
jump b
endif
step e
d:
if c == mem1:
mem3 = calc mem3 + 1
endif
if s == datacube:
step s
jump d
endif
if e == datacube:
step e
jump c
endif
step mem4
pickup c
write mem3
drop