-
Notifications
You must be signed in to change notification settings - Fork 0
/
year26.hrm
68 lines (53 loc) · 1.98 KB
/
year26.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
-- HUMAN RESOURCE MACHINE PROGRAM --
-- 26: Small Divide
-- INSTRUCTIONS: "For each two things in the INBOX, how many times does
-- the second fully fit into the first? Don't worry about negative
-- numbers, divide by zero, or remainders."
-- AVAILABLE COMMANDS: INBOX, OUTBOX, COPYFROM, COPYTO, ADD, SUB,
-- BUMPUP, BUMPDN, JUMP, JUMPZ, JUMPN, COMMENT
-- SIZE: 15 commands (challenge 15)
-- AVERAGE RUNTIME: 71 steps (challenge 76)
-- Tile 0: Dividend
-- Tile 1: Divisor
-- Tile 2: Quotient
-- Tile 9: Permanent zero
-- Repeatedly subtract the divisor from the dividend, incrementing the
-- quotient each time, until the dividend becomes negative. Place the
-- quotient in the outbox.
JUMP b
a:
COPYFROM 2
OUTBOX
b:
INBOX
COPYTO 0
INBOX
COPYTO 1
COPYFROM 9
COPYTO 2
c:
COPYFROM 0
SUB 1
JUMPN a
COPYTO 0
BUMPUP 2
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;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