viewtopic.php?f=11&t=1624#p16952
and discussed further in this thread:
viewtopic.php?f=11&t=1629
The definition of the extension to rule /235/4 is:
Code: Select all
/* Put your state count, neighbor count, and function here */
final static int numStates = 7;
final static int numOscillators = 3;
final static int numNeighbors = 8;
final static int ruleTable[][] =
{
{0,0,1,1,0,1,0,0,0},
{2,2,2,2,2,2,2,2,2},
{3,3,3,3,3,3,3,3,3},
{0,0,0,0,0,0,0,0,0},
};
/* order for nine neighbors is nw, ne, sw, se, n, w, e, s, c */
/* order for five neighbors is n, w, e, s, c */
int adjustNeighbor(int n)
{
if (n >= (numStates - numOscillators))
return n - numStates + numOscillators + 1;
return n;
}
int f(int[] a)
{
int cell = a[8];
int count = 0;
for (int i = 0; i < 8; i++)
{
int t = adjustNeighbor(a[i]);
if (t == 1)
count += t;
}
if (cell >= (numStates - numOscillators))
{
if (cell == (numStates - 1))
return numStates - numOscillators;
return cell + 1;
}
return ruleTable[cell][count];
}
Code: Select all
@RULE _235_4_O3
@TREE
num_states=7
num_neighbors=8
num_nodes=34
1 0 2 3 0 5 6 4
2 0 0 0 0 0 0 0
1 1 2 3 0 5 6 4
2 0 2 0 0 2 0 0
3 1 3 1 1 3 1 1
2 2 2 2 2 2 2 2
3 3 5 3 3 5 3 3
4 4 6 4 4 6 4 4
2 2 0 2 2 0 2 2
3 5 8 5 5 8 5 5
4 6 9 6 6 9 6 6
5 7 10 7 7 10 7 7
3 8 3 8 8 3 8 8
4 9 12 9 9 12 9 9
5 10 13 10 10 13 10 10
6 11 14 11 11 14 11 11
3 3 8 3 3 8 3 3
4 12 16 12 12 16 12 12
5 13 17 13 13 17 13 13
6 14 18 14 14 18 14 14
7 15 19 15 15 19 15 15
3 8 1 8 8 1 8 8
4 16 21 16 16 21 16 16
5 17 22 17 17 22 17 17
6 18 23 18 18 23 18 18
7 19 24 19 19 24 19 19
8 20 25 20 20 25 20 20
3 1 1 1 1 1 1 1
4 21 27 21 21 27 21 21
5 22 28 22 22 28 22 22
6 23 29 23 23 29 23 23
7 24 30 24 24 30 24 24
8 25 31 25 25 31 25 25
9 26 32 26 26 32 26 26
@COLORS
0 0 0 0
1 255 0 0
2 0 255 0
3 0 0 255
4 255 255 0
5 0 255 255
6 255 0 255
Code: Select all
x = 3, y = 3, rule = _235_4_O3
.ED$.F$F!
Code: Select all
x = 3, y = 35, rule = _235_4_O3
D.D$.F$.F$D.D11$D.D$.F2$.F$D.D11$D.D$.F3$.F$D.D!
Code: Select all
x = 5, y = 6, rule = _235_4_O3
2.D.D$3.F3$.F$D.D!
Code: Select all
x = 33, y = 33, rule = _235_4_O3
5.ABC.ABC5.ABC.ABC5.AB.F$3.ABC.ABC.ABC.ABC.ABC.ABC.ABC.F$3.ABC.ABC.
ABC.ABC.ABC.ABC.ABCDE$.3A.ABC.ABC.ABC.ABC.ABC.ABC.ABC$.2B8.ABC9.ABC
$A2CA$B2.B$C2AC$.2B$A2CA$B2.B$C2ACA$.2B.B$.2CAC$3.B$.2AC$.2B$A2CA$B
2.B$C2AC$.2B$A2CA$B2.B$C2ACA$.2B.B$.2CAC$3.B$.2AC$.2B$A2CA$B.DB$.FE
C$F!
Code: Select all
x = 14, y = 14, rule = _235_4_O3
11.ABF$11.EFB$10.ADCA$11.2B$10.C2AC$10.B2.B$10.A2CA$11.2B$11.2A2$2.
A.CBA$AEDBA.CBA$BFCBA.CBA$FBA.CBA!
Code: Select all
x = 24, y = 18, rule = _235_4_O3
E.C16.E.C$.EDB16.EDB$ACFA15.ACFA$.2B17.2B$.2AC16.2AC$3.B18.B$.2CAC15.
2CAC$.2B.B15.2B.B$C2ACA14.C2ACA$B2.B15.B2.B$A2CA15.A2CA$.2B17.2B$C2A
C15.C2AC$B2.B15.B2.B$A2CA15.A2CA$.2B17.2B$.2A17.2A$.D19.D!