-
Notifications
You must be signed in to change notification settings - Fork 0
/
year38-fast.7bh
101 lines (94 loc) · 1.44 KB
/
year38-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
-- 7 Billion Humans (2215) --
-- 38: Seek and Destroy 3 --
-- INSTRUCTIONS: "Find and shred the smallest data cube in the room."
-- AVAILABLE COMMANDS: step, pickUp, drop, giveTo, takeFrom, nearest,
-- set, if, jump, end, comment
-- SIZE: 62 commands (challenge 22, shortest known 17)
-- BEST AVERAGE RUNTIME: 25 seconds (challenge 33, fastest known 11)
if s != shredder:
-- Find the smallest cube in the column directly above and bring
-- it back to the bottom wall.
mem2 = nearest wall
step n
step n
step n
mem1 = set s
if c < mem1:
mem1 = set c
endif
if n < mem1:
mem1 = set n
endif
step n
step n
step n
if s < mem1:
mem1 = set s
endif
if c < mem1:
mem1 = set c
endif
if n < mem1:
mem1 = set n
endif
step n
step n
if c < mem1:
mem1 = set c
endif
if n < mem1:
mem1 = set n
endif
pickup mem1
step mem2
drop
step n
else:
-- Find the smallest cube in the line against the bottom wall.
mem2 = nearest shredder
step se
b:
if e != datacube:
jump b
endif
step e
c:
if e != datacube:
jump c
endif
step e
d:
if e != datacube:
jump d
endif
mem1 = set w
if c < mem1:
mem1 = set c
endif
if e < mem1:
mem1 = set e
endif
step e
step e
step e
if w < mem1:
mem1 = set w
endif
if c < mem1:
mem1 = set c
endif
if e < mem1:
mem1 = set e
endif
step e
step e
if c < mem1:
mem1 = set c
endif
if e < mem1:
mem1 = set e
endif
pickup mem1
giveto mem2
endif
-- vim: set autoindent noexpandtab