-
Notifications
You must be signed in to change notification settings - Fork 0
/
year38-fast.hrm
242 lines (225 loc) · 4.67 KB
/
year38-fast.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
-- 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: 150 commands (challenge 30)
-- AVERAGE RUNTIME: 164 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 u
a:
b:
c:
d:
e:
f:
g:
h:
i:
j:
COPYFROM 2
OUTBOX
k:
l:
m:
n:
o:
p:
q:
r:
s:
COPYFROM 1
OUTBOX
t:
COPYFROM 0
OUTBOX
u:
INBOX
COPYTO 0
SUB 11
JUMPN ad
COPYTO 0
COPYFROM 9
COPYTO 1
COPYTO 2
BUMPUP 2
COPYFROM 0
SUB 11
JUMPN v
COPYTO 0
BUMPUP 2
COPYFROM 0
SUB 11
JUMPN w
COPYTO 0
BUMPUP 2
COPYFROM 0
SUB 11
JUMPN x
COPYTO 0
BUMPUP 2
COPYFROM 0
SUB 11
JUMPN y
COPYTO 0
BUMPUP 2
COPYFROM 0
SUB 11
JUMPN z
COPYTO 0
BUMPUP 2
COPYFROM 0
SUB 11
JUMPN aa
COPYTO 0
BUMPUP 2
COPYFROM 0
SUB 11
JUMPN ab
COPYTO 0
BUMPUP 2
COPYFROM 0
SUB 11
JUMPN ac
COPYTO 0
BUMPUP 2
v:
w:
x:
y:
z:
aa:
ab:
ac:
COPYFROM 0
SUB 10
JUMPN a
COPYTO 0
BUMPUP 1
COPYFROM 0
SUB 10
JUMPN b
COPYTO 0
BUMPUP 1
COPYFROM 0
SUB 10
JUMPN c
COPYTO 0
BUMPUP 1
COPYFROM 0
SUB 10
JUMPN d
COPYTO 0
BUMPUP 1
COPYFROM 0
SUB 10
JUMPN e
COPYTO 0
BUMPUP 1
COPYFROM 0
SUB 10
JUMPN f
COPYTO 0
BUMPUP 1
COPYFROM 0
SUB 10
JUMPN g
COPYTO 0
BUMPUP 1
COPYFROM 0
SUB 10
JUMPN h
COPYTO 0
BUMPUP 1
COPYFROM 0
SUB 10
JUMPN i
COPYTO 0
BUMPUP 1
JUMP j
ad:
COPYFROM 0
SUB 10
JUMPN t
COPYTO 0
COPYFROM 9
COPYTO 1
BUMPUP 1
COPYFROM 0
SUB 10
JUMPN k
COPYTO 0
BUMPUP 1
COPYFROM 0
SUB 10
JUMPN l
COPYTO 0
BUMPUP 1
COPYFROM 0
SUB 10
JUMPN m
COPYTO 0
BUMPUP 1
COPYF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