-
Notifications
You must be signed in to change notification settings - Fork 0
/
year26-fast.7bh
68 lines (57 loc) · 1.16 KB
/
year26-fast.7bh
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
-- 7 Billion Humans (2215) --
-- 26: Budget Brigade 2 --
-- INSTRUCTIONS: "Shred data cubes of value 50 and higher on the right.
-- Smaller on the left. Shred at least 20 data cubes. No one is allowed
-- to walk."
-- AVAILABLE COMMANDS: giveTo, takeFrom, if, jump, comment
-- SIZE: 25 commands (challenge 10, shortest known 8)
-- BEST AVERAGE RUNTIME: 67 seconds (challenge 70, fastest known 67)
-- Printer duty
if s == printer:
a:
takefrom s
giveto n
jump a
endif
-- The worker at the "joint" of the "T" can be bypassed, saving time.
-- The one immediately to the south can pass cubes directly to the west
-- and east "arms" as appropriate.
if nw == worker and
ne == worker:
b:
if myitem == datacube:
if myitem < 50:
giveto nw
else:
giveto ne
endif
endif
jump b
endif
-- North-south column
if n == worker:
c:
if myitem == datacube:
giveto n
endif
jump c
endif
-- Shredder duty
if s == shredder:
d:
if myitem == datacube:
giveto s
endif
jump d
endif
-- Everyone on the west-east row, except for the shredder-ers
e:
if myitem == datacube:
if myitem < 50:
giveto w
else:
giveto e
endif
endif
jump e
-- vim: set autoindent noexpandtab