-
Notifications
You must be signed in to change notification settings - Fork 0
/
year24.hrm
50 lines (37 loc) · 1.2 KB
/
year24.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
-- HUMAN RESOURCE MACHINE PROGRAM --
-- 24: Mod Module
-- INSTRUCTIONS: "For each two things in the INBOX, OUTBOX the remainder
-- that would result if you had divided the first by the second. Don't
-- worry, you don't actually have to divide. And don't worry about
-- negative numbers for now."
-- AVAILABLE COMMANDS: INBOX, OUTBOX, COPYFROM, COPYTO, ADD, SUB,
-- BUMPUP, BUMPDN, JUMP, JUMPZ, JUMPN, COMMENT
-- SIZE: 12 commands (challenge 12)
-- AVERAGE RUNTIME: 54 steps (challenge 57)
-- Tile 0: Dividend
-- Tile 1: Divisor
-- Determine the remainder by repeatedly subtracting the divisor from
-- the dividend until the result is negative.
JUMP b
a:
COPYFROM 0
OUTBOX
b:
INBOX
COPYTO 0
INBOX
COPYTO 1
COPYFROM 0
c:
SUB 1
JUMPN a
COPYTO 0
JUMP c
DEFINE LABEL 0
eJyTYGBgkM87K706M6LeJlnw2oHEJY+BQgyz80MUZhQIynWUnZVeXz9Zfk6bolZ/93vjmkld7lumxoR8
mFaYbDDdu6xq8p8ZtpOOzg/tLNwv12Z9rLiu+yJj5aVrj3Lu3S9LvXefYRSMglEwqAEA5+AsHg;
DEFINE LABEL 1
eJyTZWBgcEqcXL0vybnga+qa+MU5Zz0Fi52dnCuOOttVcbiV1k72fdmYm5DcwlMe25bbJ93OMv9ax+z1
QV1auzj6mk6XTL107fWMkBvxc/uviC84etZ/8ecDrMuvrQYay/B6hpHZu+mlFgwTU6O4e48WrmrkXRpW
OPsuwygYBaNg0AAAoa81EA;
-- vim: set autoindent: