-
Notifications
You must be signed in to change notification settings - Fork 0
/
year31.hrm
43 lines (31 loc) · 1 KB
/
year31.hrm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
-- HUMAN RESOURCE MACHINE PROGRAM --
-- 31: String Reverse
-- INSTRUCTIONS: "For each zero terminated string in the INBOX, reverse
-- it and put the result in the OUTBOX. Repeat!"
-- AVAILABLE COMMANDS: INBOX, OUTBOX, COPYFROM, COPYTO, ADD, SUB,
-- BUMPUP, BUMPDN, JUMP, JUMPZ, JUMPN, COMMENT
-- SIZE: 10 commands (challenge 11)
-- AVERAGE RUNTIME: 121 steps (challenge 122)
-- Tile 14: Pointer
-- Starting on tile 1, write each string to the floor and sent it to the
-- outbox backwards. (Starting on tile 1 allows for a slightly more
-- compact program with no loss of speed.)
a:
b:
BUMPUP 14
INBOX
JUMPZ c
COPYTO [14]
JUMP a
c:
d:
BUMPDN 14
JUMPZ b
COPYFROM [14]
OUTBOX
JUMP d
DEFINE LABEL 14
eJzTZGBguBZZlTktsr/idWDTad3A96+BQgxC0dZZbfE7M1RyqjJl8p0LZhT0V4QVyjaHFb7vX5wTsNwo
XWnLr+QVO6ZE6e2dF6a3F6QnqGu6kkTHZ7OMpqa5Lxszd+Y2HDwFEucsE/RJmS3oA2L7L34ePXnhzmkx
83L3gPieS0Nq2Jd5lxWvLU17taEw2WNvYbLz/i2pILnZ8wr3x8yzP8kwCkbBKKAZAACx10Hy;
-- vim: set autoindent: