-
Notifications
You must be signed in to change notification settings - Fork 11
/
Worm-1042015.rule
181 lines (157 loc) · 4.68 KB
/
Worm-1042015.rule
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
@RULE Worm-1042015
Paterson's worms (by Dean Hickerson, 11/20/2008)
Pattern #061
Sven Kahrkling's notation 1042015
Gardner's notation 1a2c3caca4a
Final outcome unknown; doesn't finish within 1.3*10^18 steps.
Very chaotic.
Points and lines of hexagonal grid are mapped to points of square grid as
below. "*" is a point of the hex grid, "-", "/", and "\" are lines
of the hex grid.
+--+--+--+--+
|- |* |- |* |
+--+--+--+--+
| /| \| /| \|
+--+--+--+--+
|* |- |* |- |
+--+--+--+--+
Each step of the worm is simulated by 2 gens in the rule. In even gens,
there's an arrow at one point of the hex grid showing which way the worm
will move next. In odd gens, there's an arrow on one line of the hex
grid. The transitions from even to odd gens are the same for all worms.
Those from odd to even depend on the specific type of worm: If a point
(state 0 or 1) has a line with an arrow pointing at it, it becomes a
'point with arrow'; the direction depends on the 6 neighboring lines,
which are the NW, N, E, S, SW, and W neighbors in the square grid.
Gen 0 consists of a single point in state 1, a 'point with arrow'
pointing east. (Starting with a point in state 2, 3, 4, 5, or 6
would also work, rotating the whole pattern.)
States are:
0 empty (unvisited point or line)
1-6 'point with arrow', showing direction of next movement
(1=E; 2=SE; 3=SW; 4=W; 5=NW; 6=NE)
7 point that's been visited
8,9,10 edge - (8=line; 9=E arrow; 10=W arrow)
11,12,13 edge / (11=line; 12=NE arrow; 13=SW arrow)
14,15,16 edge \ (14=line; 15=SE arrow; 16=NW arrow)
@TABLE
n_states:17
neighborhood:Moore
symmetries:none
var point={1,2,3,4,5,6}
var a0={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var a1={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var a2={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var a3={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var a4={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var a5={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var a6={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var a7={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
var n={8,11,14}
var o={8,11,14}
var p={8,11,14}
var q={8,11,14}
var b={0,7}
# point with arrow becomes point that's been visited
point,a0,a1,a2,a3,a4,a5,a6,a7,7
# line with arrow becomes line without arrow
9,a0,a1,a2,a3,a4,a5,a6,a7,8
10,a0,a1,a2,a3,a4,a5,a6,a7,8
12,a0,a1,a2,a3,a4,a5,a6,a7,11
13,a0,a1,a2,a3,a4,a5,a6,a7,11
15,a0,a1,a2,a3,a4,a5,a6,a7,14
16,a0,a1,a2,a3,a4,a5,a6,a7,14
# point with arrow creates line with arrow next to it
0,a0,a1,a2,a3,a4,a5,1,a6,9
0,2,a0,a1,a2,a3,a4,a5,a6,15
0,a0,3,a1,a2,a3,a4,a5,a6,13
0,a0,a1,4,a2,a3,a4,a5,a6,10
0,a0,a1,a2,5,a3,a4,a5,a6,16
0,a0,a1,a2,a3,6,a4,a5,a6,12
# 4 eaten: use only remaining direction
# 0 (straight):
b,0,a0,n,a1,o,12,p,q,6
b,n,a0,0,a1,o,p,9,q,1
b,n,a0,o,a1,0,p,q,15,2
b,13,a0,n,a1,o,0,p,q,3
b,n,a0,10,a1,o,p,0,q,4
b,n,a0,o,a1,16,p,q,0,5
# 1 (gentle right):
b,n,a0,0,a1,o,12,p,q,1
b,n,a0,o,a1,0,p,9,q,2
b,n,a0,o,a1,p,0,q,15,3
b,13,a0,n,a1,o,p,0,q,4
b,n,a0,10,a1,o,p,q,0,5
b,0,a0,n,a1,16,o,p,q,6
# 2 (sharp right):
b,n,a0,o,a1,0,12,p,q,2
b,n,a0,o,a1,p,0,9,q,3
b,n,a0,o,a1,p,q,0,15,4
b,13,a0,n,a1,o,p,q,0,5
b,0,a0,10,a1,n,o,p,q,6
b,n,a0,0,a1,16,o,p,q,1
# 4 (sharp left):
b,n,a0,o,a1,p,12,0,q,4
b,n,a0,o,a1,p,q,9,0,5
b,0,a0,n,a1,o,p,q,15,6
b,13,a0,0,a1,n,o,p,q,1
b,n,a0,10,a1,0,o,p,q,2
b,n,a0,o,a1,16,0,p,q,3
# 5 (gentle left):
b,n,a0,o,a1,p,12,q,0,5
b,0,a0,n,a1,o,p,9,q,6
b,n,a0,0,a1,o,p,q,15,1
b,13,a0,n,a1,0,o,p,q,2
b,n,a0,10,a1,o,0,p,q,3
b,n,a0,o,a1,16,p,0,q,4
# rule-specific transitions at point with arrow coming in
# rule 1042015
# none eaten: 1 = gentle right
b,0,a0,0,a1,0,12,0,0,1
b,0,a0,0,a1,0,0,9,0,2
b,0,a0,0,a1,0,0,0,15,3
b,13,a0,0,a1,0,0,0,0,4
b,0,a0,10,a1,0,0,0,0,5
b,0,a0,0,a1,16,0,0,0,6
# 1 eaten(1): 0 = straight
b,0,a0,n,a1,0,12,0,0,6
b,0,a0,0,a1,n,0,9,0,1
b,0,a0,0,a1,0,n,0,15,2
b,13,a0,0,a1,0,0,n,0,3
b,0,a0,10,a1,0,0,0,n,4
b,n,a0,0,a1,16,0,0,0,5
# 2 eaten(02): 4 = sharp left
b,n,a0,0,a1,o,12,0,0,4
b,0,a0,n,a1,0,o,9,0,5
b,0,a0,0,a1,n,0,o,15,6
b,13,a0,0,a1,0,n,0,o,1
b,o,a0,10,a1,0,0,n,0,2
b,0,a0,o,a1,16,0,0,n,3
# 2 eaten(15): 2 = sharp right
b,0,a0,o,a1,0,12,0,n,2
b,n,a0,0,a1,o,0,9,0,3
b,0,a0,n,a1,0,o,0,15,4
b,13,a0,0,a1,n,0,o,0,5
b,0,a0,10,a1,0,n,0,o,6
b,o,a0,0,a1,16,0,n,0,1
# 2 eaten(24): 0 = straight
b,0,a0,0,a1,n,12,o,0,6
b,0,a0,0,a1,0,n,9,o,1
b,o,a0,0,a1,0,0,n,15,2
b,13,a0,o,a1,0,0,0,n,3
b,n,a0,10,a1,o,0,0,0,4
b,0,a0,n,a1,16,o,0,0,5
# 2 eaten(04): 1 = gentle right
b,n,a0,0,a1,0,12,o,0,1
b,0,a0,n,a1,0,0,9,o,2
b,o,a0,0,a1,n,0,0,15,3
b,13,a0,o,a1,0,n,0,0,4
b,0,a0,10,a1,o,0,n,0,5
b,0,a0,0,a1,16,o,0,n,6
# 3 eaten(124): 5 = gentle left
b,0,a0,n,a1,o,12,p,0,5
b,0,a0,0,a1,n,o,9,p,6
b,p,a0,0,a1,0,n,o,15,1
b,13,a0,p,a1,0,0,n,o,2
b,o,a0,10,a1,p,0,0,n,3
b,n,a0,o,a1,16,p,0,0,4