I made a rule to simulate waves that can go through each other (with delay) and bounce off walls. Rules:
A state 0 cell touching a state 1 cell becomes state 1.
A state 1 cell becomes state 2.
A state 2 cell becomes state 0 if touching state 1, otherwise state 1.
Code: Select all
@RULE mwave
@TABLE
n_states:6
neighborhood:Moore
symmetries:permute
var a={0,1,2,3,5}
var a1=a
var a2=a
var a3=a
var a4=a
var a5=a
var a6=a
var a7=a
var a8=a
0,1,a2,a3,a4,a5,a6,a7,a8,1
1,a1,a2,a3,a4,a5,a6,a7,a8,2
2,1,a2,a3,a4,a5,a6,a7,a8,0
2,5,a2,a3,a4,a5,a6,a7,a8,0
2,a1,a2,a3,a4,a5,a6,a7,a8,1
@COLORS
0 48 48 48
1 255 0 0
2 255 255 0
3 255 255 255
4 0 255 255
5 0 0 255
The ruletable also includes:
state 3 (wall),
state 4 (big wall, cells around it stay constant, effectively being a 3*3 square wall. Don't put state 1 next to it),
state 5 (absorber, state-2 cells around it always become state-0).
Demo (showing off infinite echo):
Code: Select all
x = 112, y = 81, rule = mwave
22.C$22.C$22.C$22.C$22.C$22.C$22.C$22.C$22.C$22.C25$A6$111.C$111.C$
111.C$111.C$111.C$111.C$111.C$111.C$111.C$111.C$111.C$111.C$111.C$
111.C$111.C$111.C$111.C$41.A69.C$111.C$111.C21$4.A!
Properties:
Generalisable to different numbers of states and neighborhoods
Chaotic (small differences become big differences)
Waves enclosed in a box create weird gradients that act like heat
Some scale-invariance
Reversible by switching states 1 and 2(as long as you don't use state-5 or put state-1 next to state-4)
Heat simulation demo (the left side is "hot" and the right is "cold", and they slowly become even):
Code: Select all
x = 168, y = 38, rule = mwave
44.36D$30.14D36.23D$18.12D73.8D$14.4D93.13D$11.3D110.11D$8.3D124.5D$
7.D132.6D$5.2D139.13D$3.2D154.3D$3.D158.D$.2D53.A105.D$.D161.2D$.D
162.D$D163.D$D163.D$D164.D$D164.2D$D165.D$D165.D$D165.D$D166.D$.D165.
D$.2D164.D$3.D163.D$4.D162.D$4.D162.D$5.D161.D$6.D160.D$7.2D156.2D$9.
2D153.D$11.3D149.2D$14.4D144.D$18.3D138.3D$21.4D127.7D$25.6D118.3D$
31.11D104.3D$42.40D58.6D$82.58D!
Scale-invariance demo (the large box takes 2 times longer):
Code: Select all
x = 72, y = 42, rule = mwave
22C8.42C$C20.C8.C40.C$C20.C8.C40.C$C4.2A14.C8.C40.C$C4.2A14.C8.C40.C$
C20.C8.C8.4A28.C$C20.C8.C8.4A28.C$C20.C8.C8.4A28.C$C20.C8.C8.4A28.C$C
20.C8.C40.C$C20.C8.C40.C$C20.C8.C40.C$C20.C8.C40.C$C20.C8.C40.C$C20.C
8.C40.C$C20.C8.C40.C$C20.C8.C40.C$C20.C8.C40.C$C20.C8.C40.C$C20.C8.C
40.C$C20.C8.C40.C$22C8.C40.C$30.C40.C$30.C40.C$30.C40.C$30.C40.C$30.C
40.C$30.C40.C$30.C40.C$30.C40.C$30.C40.C$30.C40.C$30.C40.C$30.C40.C$
30.C40.C$30.C40.C$30.C40.C$30.C40.C$30.C40.C$30.C40.C$30.C40.C$30.42C
!
Reversibility demo (check gen 1111):
Code: Select all
x = 40, y = 40, rule = mwave
40C$C4A4.A3.BAB.4B.A.B4.B.3B2.2BAC$C6A.2A2.6B.B6.BC.CB.7BC$C2A.2A.A.
2A.2B.B2.B.B2.3B.B.C2B.4B2.C$CA.2A7.4B.2B.2B3.B.C.C4B2A2B.C$CA5.B.B4.
3B2.4B.B.6B4A3BC$CA2.2B.B.2B2.2B.4B2A5B3ABA2BAB2ABC$C2.2B2.B2.4B.B2.B
ABA4BAB2A2B7AC$C6.B.3B3.B.4BAB2ABABABAB3A3.AC$C3B.B2.8B.B.BABA4BABA2B
7AC$C3.B.4B2.3B.B2.3BA2B3A7B3ABC$C4B5.B4.2B.B.BA2B3A3BAB4ABABC$C3B.6B
.A4.4BAB4A3BA2BAB2A2BC$CB.2B2.3B4.2B2.4BAB5AB3A3B3AC$C.2B2.3B2.B2.B3.
2B7AB3A.A3B3AC$C3.B.9B3.5B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