-
Notifications
You must be signed in to change notification settings - Fork 0
/
year30-fast.7bh
116 lines (103 loc) · 1.74 KB
/
year30-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
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
-- 7 Billion Humans (2215) --
-- 30: Fill the Floor --
-- INSTRUCTIONS: "Fill the floor with data cubes!"
-- AVAILABLE COMMANDS: step, pickUp, drop, takeFrom, nearest, if, jump,
-- end, comment
-- SIZE: 59 commands (challenge 6, shortest known 5)
-- BEST AVERAGE RUNTIME: 126 seconds (challenge 170, fastest known 119)
mem1 = nearest printer
if w == nothing and
e == worker:
if n == wall:
-- Northwest worker in the nook: Fill the floor starting
-- in the northwest corner.
a:
takefrom mem1
step w
step w
step nw
b:
if c == datacube:
step nw,w,sw,n,s,ne,e,se
jump b
endif
drop
jump a
endif
-- Southwest worker in the nook: Fill the floor starting in the
-- southwest corner.
c:
takefrom mem1
step sw
step sw
step w
d:
if c == datacube:
step nw,w,sw,n,s,ne,e,se
jump d
endif
drop
jump c
endif
-- Eastern workers in the nook: Fill the floor starting in the southeast
-- corner (in the nook).
if e == wall:
e:
takefrom mem1
step se
step se
step e
step e
step e
f:
if c == datacube:
step nw,w,sw,n,s,ne,e,se
jump f
endif
drop
jump e
endif
-- North-center worker in the nook: Fill the floor starting in the
-- northeast corner.
if n == wall:
g:
takefrom mem1
step e
step e
step ne
h:
if c == datacube:
step nw,w,sw,n,s,ne,e,se
jump h
endif
drop
jump g
endif
-- South-center worker in the nook: Fill the floor starting near the
south wall.
if s == wall:
i:
takefrom mem1
step se
step s
j:
if c == datacube:
step nw,w,sw,n,s,ne,e,se
jump j
endif
drop
jump i
endif
-- Worker who starts off near the printer: Fill the floor starting near
the north wall.
k:
takefrom mem1
step n
l:
step nw,w,sw,n,s,ne,e,se
if c == datacube:
jump l
endif
drop
jump k
-- vim: set autoindent noexpandtab