I think these kind of rules don't fit well with golly.
When I make the rule with only 16 states, golly chokes pretty much with it.
EDIT: Okay, 16 states works pretty well with small random areas.
However, with 32 states golly takes a lot of time even just to open the rule file. Probably because it isn't optimized. And it takes an eternaty to undo.
I assumed that if the neighbor cells are like the following,
Then the center cell becomes C' = C%4 + N/4 + W/4 + E/4 + S/4.
It is not hard to make the rule file itself:
ripplemaker.py
Code: Select all
import sys
def transition(c, n, e, s, w):
return c%4 + n/4 + e/4 + s/4 + w/4
def printtrans(maxstate):
for c in xrange(maxstate):
for n in xrange(maxstate):
for e in xrange(n+1):
for s in xrange(e+1):
for w in xrange(s+1):
print '{}, {}, {}, {}, {}, {}'\
.format(c, n, e, s, w, transition(c, n, e, s, w))
def printrule(rulename, nstates):
print '@RULE {}'.format(rulename)
print '@TABLE'
print 'n_states:{}'.format(nstates)
print 'neighborhood:vonNeumann'
print 'symmetries:permute'
printtrans(nstates)
# Starts here
rulefilename = sys.argv[1]
numstates = int(sys.argv[2])
printrule(rulefilename, numstates)
invoke it with: (sorry about the redundant params... It's just a throwaway script.)
Code: Select all
ripplemaker.py rulename num_states > rulename.rule
e.g.
Code: Select all
ripplemaker.py sean16 16 > sean16.rule
Warning: Sean's original rule has an unbounded number of states, while this version is bounded. This makes the golly implementation a small quirk.(You can skip to conclusion)
e.g. if there are 5 states (0 thru 4), the center cell in the following becomes state 5 (not allowed!)
If there are N states (0 thru N-1) the maximum state a center cell could have is:
3 + 4 * {(N-1)/4}, and this should be less than N.
if N-1=4q+r(q:quotient, r:remainder), 3 + 4q < 4q+r+1, r>2.
Conclusion: N must be 0 or 3 (mod4) in order for the rule to work in bounded number of states.