final static int ruleTable[][] =
{
{0,0,1,0,0,0,0,0,0},
{2,2,2,1,1,1,2,2,2},
{3,3,3,3,3,3,3,3,3},
{0,0,0,0,0,0,0,0,0}
};
To obtain the next state of a cell, the table columns are indexed by the sum of the eight nearest neighbors in state one and the table rows are indexed by the current state of the cell.
Many variations of this table generate solitaire games that are novel, challenging and addictive. One such table is the following:
final static int ruleTable[][] =
{
{0,0,1,0,0,0,0,0,0},
{2,4,2,1,1,1,2,2,2},
{3,3,3,3,3,3,3,3,3},
{4,4,4,4,4,4,4,4,4},
{0,0,0,0,0,0,0,0,0}
};
The corresponding Golly rule is:
Code: Select all
@RULE SWV1
@TREE
num_states=5
num_neighbors=8
num_nodes=38
1 0 2 3 4 0
1 0 4 3 4 0
2 0 1 0 0 0
1 1 2 3 4 0
2 1 3 1 1 1
3 2 4 2 2 2
1 0 1 3 4 0
2 3 6 3 3 3
3 4 7 4 4 4
4 5 8 5 5 5
2 6 6 6 6 6
3 7 10 7 7 7
4 8 11 8 8 8
5 9 12 9 9 9
3 10 10 10 10 10
4 11 14 11 11 11
5 12 15 12 12 12
6 13 16 13 13 13
2 6 0 6 6 6
3 10 18 10 10 10
4 14 19 14 14 14
5 15 20 15 15 15
6 16 21 16 16 16
7 17 22 17 17 17
2 0 0 0 0 0
3 18 24 18 18 18
4 19 25 19 19 19
5 20 26 20 20 20
6 21 27 21 21 21
7 22 28 22 22 22
8 23 29 23 23 23
3 24 24 24 24 24
4 25 31 25 25 25
5 26 32 26 26 26
6 27 33 27 27 27
7 28 34 28 28 28
8 29 35 29 29 29
9 30 36 30 30 30
@COLORS
0 0 0 0
1 255 0 0
2 0 255 0
3 0 0 255
4 255 255 0
Brian Prentice
