第 24 关,模运算。指令介绍请看:https://www.annhe.net/article-3828.html。
优化目标
12行57步
代码
12行54步
JUMP main
out:
COPYFROM 0
OUTBOX
main:
INBOX
COPYTO 0
INBOX
COPYTO 1
COPYFROM 0
divide:
SUB 1
JUMPN out
COPYTO 0
JUMP divide
第一次pass 12行58步
JUMP main
out:
COPYFROM 0
OUTBOX
main:
INBOX
COPYTO 0
INBOX
COPYTO 1
divide:
COPYFROM 0
SUB 1
JUMPN out
COPYTO 0
JUMP divide
11行50步
-- HUMAN RESOURCE MACHINE PROGRAM --
JUMP b
a:
ADD 1
OUTBOX
b:
INBOX
COPYTO 0
INBOX
COPYTO 1
COPYFROM 0
c:
SUB 1
JUMPN a
JUMP c
-- HUMAN RESOURCE MACHINE PROGRAM --
JUMP c
a:
ADD 1
b:
OUTBOX
c:
INBOX
COPYTO 0
INBOX
COPYTO 1
COPYFROM 0
d:
SUB 1
JUMPN a
JUMPZ b
JUMP d
我搞的比你少两步。。。。。
厉害