-
Notifications
You must be signed in to change notification settings - Fork 0
/
year38-small.hrm
98 lines (81 loc) · 2.78 KB
/
year38-small.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
-- HUMAN RESOURCE MACHINE PROGRAM --
-- 38: Digit Exploder
-- INSTRUCTIONS: "Grab each number from the INBOX, and send its digits
-- to the OUTBOX. For example, 123 becomes 1, 2, 3."
-- AVAILABLE COMMANDS: INBOX, OUTBOX, COPYFROM, COPYTO, ADD, SUB,
-- BUMPUP, BUMPDN, JUMP, JUMPZ, JUMPN, COMMENT
-- SIZE: 28 commands (challenge 30)
-- AVERAGE RUNTIME: 207 steps (challenge 165)
-- Tile 0: Initially, the number to break up; eventually, the ones digit
-- Tile 1: Tens digit
-- Tile 2: Hundreds digit
-- Copy the item from the inbox to the floor. Maintaining
-- a counter, repeatedly subtract 100 from the initial value until it
-- is less than 100. Do this again for 10. The values of the counters
-- are the hundreds and tens digits; the remainder left on tile 0 is the
-- ones digit. When sending these to the outbox, omit leading zeros as
-- necessary.
JUMP d
a:
COPYFROM 1
JUMPZ c
b:
OUTBOX
c:
COPYFROM 0
OUTBOX
d:
COPYFROM 9
COPYTO 1
COPYTO 2
INBOX
COPYTO 0
e:
SUB 11
JUMPN f
COPYTO 0
BUMPUP 2
COPYFROM 0
JUMP e
f:
g:
COPYFROM 0
SUB 10
JUMPN h
COPYTO 0
BUMPUP 1
JUMP g
h:
COPYFROM 2
JUMPZ a
OUTBOX
COPYFROM 1
JUMP b
DEFINE LABEL 0
eJwTYgCCpCWR9kmZ3QcS3Re6x7ufBwn9Sq7L+ZFilLI5bU383bxr/mGFl3zMat1dVzVe8pFrq8qMaucp
j2rv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