Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
executable file 315 lines (297 sloc) 5.94 KB
-- HUMAN RESOURCE MACHINE PROGRAM --
-- 41-Sorting-Floor - SIZE 220/34 - SPEED 258/714 --
-- This solution is level-specific (patterned and quantity-limited input).
-- First and last string use a hard-coded sort order.
-- Second string is sorted using tree of hard-coded sorts.
-- Third string is sorted using a merge-sort.
INBOX
COPYTO 0
INBOX
OUTBOX
INBOX
OUTBOX
COPYFROM 0
OUTBOX
INBOX
BUMPUP 24
BUMPUP 24
ADD 24
COPYTO 22
COPYTO 19
BUMPUP 19
ADD 22
COPYTO 21
BUMPUP 19
INBOX
COPYTO 0
INBOX
COPYTO 1
SUB 0
SUB 21
JUMPN d
JUMPZ g
SUB 22
JUMPN b
JUMPZ c
SUB 22
JUMPN a
INBOX
OUTBOX
COPYFROM 0
OUTBOX
INBOX
COPYTO 0
INBOX
JUMP m
a:
INBOX
OUTBOX
COPYFROM 0
OUTBOX
INBOX
OUTBOX
INBOX
JUMP n
b:
COPYFROM 0
OUTBOX
COPYFROM 1
COPYTO 0
INBOX
COPYTO 3
JUMP h
c:
INBOX
COPYTO 3
INBOX
OUTBOX
COPYFROM 0
OUTBOX
INBOX
COPYTO 0
JUMP j
d:
COPYFROM 1
SUB 0
ADD 21
SUB 22
JUMPN e
JUMPZ f
INBOX
COPYTO 4
INBOX
COPYTO 3
INBOX
OUTBOX
COPYFROM 4
JUMP i
e:
COPYFROM 1
OUTBOX
COPYFROM 0
COPYTO 1
INBOX
OUTBOX
INBOX
COPYTO 0
INBOX
JUMP l
f:
COPYFROM 1
OUTBOX
COPYFROM 0
COPYTO 3
INBOX
COPYTO 0
INBOX
COPYTO 1
INBOX
OUTBOX
COPYFROM 0
SUB 1
ADD 22
JUMPN k
COPYFROM 0
OUTBOX
COPYFROM 1
OUTBOX
COPYFROM 3
JUMP o
g:
COPYFROM 0
OUTBOX
COPYFROM 1
COPYTO 3
INBOX
COPYTO 0
h:
INBOX
COPYTO 1
INBOX
i:
OUTBOX
j:
k:
COPYFROM 3
l:
m:
OUTBOX
COPYFROM 0
n:
OUTBOX
COPYFROM 1
o:
OUTBOX
INBOX
INBOX
COPYTO 6
COPYTO 7
INBOX
SUB 6
JUMPN p
ADD 6
COPYTO 7
JUMP t
p:
ADD 6
COPYTO 6
JUMP u
q:
COPYFROM [20]
COPYTO [18]
BUMPUP 20
r:
s:
BUMPUP 18
COPYFROM [20]
SUB 8
JUMPN q
COPYFROM 8
COPYTO [18]
t:
u:
INBOX
COPYTO 9
COPYTO 8
INBOX
SUB 9
JUMPN v
ADD 9
COPYTO 8
COPYFROM 19
JUMPZ aa
COPYTO 20
SUB 24
COPYTO 18
COPYTO 19
COPYFROM [20]
SUB 9
JUMPN x
COPYFROM 9
COPYTO [18]
JUMP r
v:
ADD 9
COPYTO 9
COPYFROM 19
JUMPZ ab
COPYTO 20
SUB 24
COPYTO 18
COPYTO 19
COPYFROM 9
SUB [20]
JUMPN y
w:
x:
COPYFROM [20]
COPYTO [18]
BUMPUP 18
BUMPUP 20
COPYFROM [20]
SUB 9
JUMPN w
y:
COPYFROM 9
COPYTO [18]
JUMP s
z:
COPYFROM [19]
OUTBOX
BUMPUP 19
aa:
ab:
COPYFROM [19]
SUB 9
JUMPN z
COPYFROM 9
OUTBOX
JUMP ad
ac:
COPYFROM [19]
OUTBOX
BUMPUP 19
ad:
COPYFROM [19]
SUB 8
JUMPN ac
COPYFROM 8
OUTBOX
INBOX
COPYTO 8
ae:
COPYFROM [19]
JUMPZ ag
OUTBOX
BUMPUP 19
COPYFROM [19]
JUMPZ af
OUTBOX
BUMPUP 19
COPYFROM [19]
JUMPZ ah
OUTBOX
BUMPUP 19
JUMP ae
af:
ag:
ah:
INBOX
OUTBOX
DEFINE LABEL 0
eJxTYmBg+KYZK/tNc2rCLu23ie5WvTFvbZ7GKtq7JZs7fUsFSjMwO2yTY3Zgz+tyPru4y9l+I0hseqSv
6NYIVhmXiHJNl4jDviAxO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