The rule I will request is the same as life but:
- if a dead cell is surrounded by eight neighbors it creates a grey cell from lifehistory
if a grey cell is surrounded by eight neighbors it dies
I though I was in OCA. Can a mod move this?A for awesome wrote:Shouldn't this be in Other Cellular Automata?
Moved.drc wrote:I though I was in OCA. Can a mod move this?
Here you go:drc wrote:The rule I will request is the same as life but:
- if a dead cell is surrounded by eight neighbors it creates a grey cell from lifehistory
if a grey cell is surrounded by eight neighbors it dies
Code: Select all
@RULE GreyLife
@TABLE
n_states:3
neighborhood:Moore
symmetries:permute
var a={0,1,2}
var aa=a
var ab=a
var ac=a
var ad=a
var ae=a
var af=a
var ag=a
var o={0,2}
var oa=o
var ob=o
var oc=o
var od=o
var oe=o
var of=o
var og=o
0,1,1,1,o,oa,ob,oc,od,1
0,1,1,1,1,1,1,1,1,2
1,a,o,oa,ob,oc,od,oe,of,0
1,1,1,1,1,a,aa,ab,ac,0
1,2,a,aa,ab,ac,ad,ae,af,0
2,1,1,1,1,1,1,1,1,0
@COLORS
0 0 0 0
1 255 255 255
2 100 100 100
Saka wrote:I would like B2in3/S123a
Code: Select all
@RULE B2in3S123a
@TABLE
n_states:2
neighborhood:Moore
symmetries:rotate4reflect
0,1,0,0,0,1,0,0,0,1
0,0,1,0,0,0,1,0,0,1
0,1,1,1,0,0,0,0,0,1
0,1,1,0,1,0,0,0,0,1
0,1,1,0,0,1,0,0,0,1
0,1,1,0,0,0,1,0,0,1
0,1,1,0,0,0,0,1,0,1
0,1,1,0,0,0,0,0,1,1
0,1,0,1,0,1,0,0,0,1
0,1,0,1,0,0,1,0,0,1
0,1,0,0,1,0,1,0,0,1
0,0,1,0,1,0,1,0,0,1
1,0,0,0,0,0,0,0,0,0
1,1,1,0,1,0,0,0,0,0
1,1,1,0,0,1,0,0,0,0
1,1,1,0,0,0,1,0,0,0
1,1,1,0,0,0,0,1,0,0
1,1,1,0,0,0,0,0,1,0
1,1,0,1,0,1,0,0,0,0
1,1,0,1,0,0,1,0,0,0
1,1,0,0,1,0,1,0,0,0
1,0,1,0,1,0,1,0,0,0
1,1,1,1,1,0,0,0,0,0
1,1,1,1,0,1,0,0,0,0
1,1,1,1,0,0,1,0,0,0
1,1,1,0,1,1,0,0,0,0
1,1,1,0,1,0,1,0,0,0
1,1,1,0,1,0,0,1,0,0
1,1,1,0,1,0,0,0,1,0
1,1,1,0,0,1,1,0,0,0
1,1,1,0,0,1,0,1,0,0
1,1,1,0,0,1,0,0,1,0
1,1,1,0,0,0,1,1,0,0
1,1,0,1,0,1,0,1,0,0
1,0,1,0,1,0,1,0,1,0
1,0,0,0,1,1,1,1,1,0
1,0,0,1,0,1,1,1,1,0
1,0,0,1,1,0,1,1,1,0
1,0,0,1,1,1,0,1,1,0
1,0,0,1,1,1,1,0,1,0
1,0,0,1,1,1,1,1,0,0
1,0,1,0,1,0,1,1,1,0
1,0,1,0,1,1,0,1,1,0
1,0,1,1,0,1,0,1,1,0
1,1,0,1,0,1,0,1,1,0
1,0,0,1,1,1,1,1,1,0
1,0,1,0,1,1,1,1,1,0
1,0,1,1,0,1,1,1,1,0
1,0,1,1,1,0,1,1,1,0
1,1,0,1,0,1,1,1,1,0
1,1,0,1,1,1,0,1,1,0
1,0,1,1,1,1,1,1,1,0
1,1,0,1,1,1,1,1,1,0
1,1,1,1,1,1,1,1,1,0
That seems right. If the intention is for gray cells to appear rarely but also disappear about equally rarely, then the grey-cell-killing neighbor number should be reduced quite a bit. Here grey cells get destroyed if they have six neighbors (which I think is the maximum possible):A for awesome wrote:I think there is actually no way for 8 live cells to end up surrounding a grey one...drc wrote:The rule I will request is the same as life but:
- if a dead cell is surrounded by eight neighbors it creates a grey cell from lifehistory
if a grey cell is surrounded by eight neighbors it dies
Code: Select all
@RULE GreyLifeSix
@TABLE
n_states:3
neighborhood:Moore
symmetries:permute
var a={0,1,2}
var b={0,1,2}
var aa=a
var ab=a
var ac=a
var ad=a
var ae=a
var af=a
var ag=a
var o={0,2}
var oa=o
var ob=o
var oc=o
var od=o
var oe=o
var of=o
var og=o
0,1,1,1,o,oa,ob,oc,od,1
0,1,1,1,1,1,1,1,1,2
1,a,o,oa,ob,oc,od,oe,of,0
1,1,1,1,1,a,aa,ab,ac,0
1,2,a,aa,ab,ac,ad,ae,af,0
2,1,1,1,1,1,1,a,b,0
@COLORS
0 0 0 0
1 255 255 255
2 100 100 100
Code: Select all
x = 5, y = 5, rule = GreyLifeSix
.3A2$A.B.A2$.3A!
Okay, time to write a non-totalistic rule builder script to throw into Golly's Rule-Generators folder.Saka wrote:Great! Now I would like (again! Sorry..) b3s123eik4ce
and B3-a4k5kai/S1e2-i34-eczt
I've stuck together the appropriate pieces from wildmyron's isotropic apgsearch package and made a single script. Haven't tested it at all thoroughly yet -- just checked to make sure that tlife patterns work with a rule generated by entering B3/S2-i34q.dvgrn wrote:Okay, time to write a non-totalistic rule builder script to throw into Golly's Rule-Generators folder.Saka wrote:Great! Now I would like (again! Sorry..) b3s123eik4ce
and B3-a4k5kai/S1e2-i34-eczt
Does anyone have a script already?
...wildmyron's isotropicRulegen.py... seems to have the correct "n" instead of the old Life32 "v".
Code: Select all
# isotropic-rule-gen.py, version 1.1
# Change from v1.0:
# added @ICONS section to output rule, to avoid triggering shared-rule logic in Golly
#
# isotropic-rule.py / isotropicRulegen.py
# Auxillary rule generator from wildmyron's non-totalistic version of apgsearch
# The rulespace is the set of isotropic non-totalistic rules on the Moore
# neighbourhood, using Alan Hensel's notation.
# See http://www.ibiblio.org/lifepatterns/neighbors2.html
# Generate a rule table for an isotropic rule using Alan Hensel's
# isotropic, non-totalistic rule format for CA on the Moore neighbourhood
import golly as g
import os
# Generates the helper rules for apgsearch-isotropic, given a base isotropic
# rule in Hensel's notation.
class RuleGenerator:
# notationdict adapted from Eric Goldstein's HenselNotation->Ruletable(1.3).py
# Modified for neighbourhood2 version of Hensel's notation
notationdict = {
"0" : [0,0,0,0,0,0,0,0], #
"1e" : [1,0,0,0,0,0,0,0], # N
"1c" : [0,1,0,0,0,0,0,0], # NE
"2a" : [1,1,0,0,0,0,0,0], # N, NE
"2e" : [1,0,1,0,0,0,0,0], # N, E
"2k" : [1,0,0,1,0,0,0,0], # N, SE
"2i" : [1,0,0,0,1,0,0,0], # N, S
"2c" : [0,1,0,1,0,0,0,0], # NE, SE
"2n" : [0,1,0,0,0,1,0,0], # NE, SW
"3a" : [1,1,1,0,0,0,0,0], # N, NE, E
"3n" : [1,1,0,1,0,0,0,0], # N, NE, SE
"3r" : [1,1,0,0,1,0,0,0], # N, NE, S
"3q" : [1,1,0,0,0,1,0,0], # N, NE, SW
"3j" : [1,1,0,0,0,0,1,0], # N, NE, W
"3i" : [1,1,0,0,0,0,0,1], # N, NE, NW
"3e" : [1,0,1,0,1,0,0,0], # N, E, S
"3k" : [1,0,1,0,0,1,0,0], # N, E, SW
"3y" : [1,0,0,1,0,1,0,0], # N, SE, SW
"3c" : [0,1,0,1,0,1,0,0], # NE, SE, SW
"4a" : [1,1,1,1,0,0,0,0], # N, NE, E, SE
"4r" : [1,1,1,0,1,0,0,0], # N, NE, E, S
"4q" : [1,1,1,0,0,1,0,0], # N, NE, E, SW
"4i" : [1,1,0,1,1,0,0,0], # N, NE, SE, S
"4y" : [1,1,0,1,0,1,0,0], # N, NE, SE, SW
"4k" : [1,1,0,1,0,0,1,0], # N, NE, SE, W
"4n" : [1,1,0,1,0,0,0,1], # N, NE, SE, NW
"4z" : [1,1,0,0,1,1,0,0], # N, NE, S, SW
"4j" : [1,1,0,0,1,0,1,0], # N, NE, S, W
"4t" : [1,1,0,0,1,0,0,1], # N, NE, S, NW
"4w" : [1,1,0,0,0,1,1,0], # N, NE, SW, W
"4e" : [1,0,1,0,1,0,1,0], # N, E, S, W
"4c" : [0,1,0,1,0,1,0,1], # NE, SE, SW, NW
"5i" : [1,1,1,1,1,0,0,0], # N, NE, E, SE, S
"5j" : [1,1,1,1,0,1,0,0], # N, NE, E, SE, SW
"5n" : [1,1,1,1,0,0,1,0], # N, NE, E, SE, W
"5a" : [1,1,1,1,0,0,0,1], # N, NE, E, SE, NW
"5q" : [1,1,1,0,1,1,0,0], # N, NE, E, S, SW
"5c" : [1,1,1,0,1,0,1,0], # N, NE, E, S, W
"5r" : [1,1,0,1,1,1,0,0], # N, NE, SE, S, SW
"5y" : [1,1,0,1,1,0,1,0], # N, NE, SE, S, W
"5k" : [1,1,0,1,0,1,1,0], # N, NE, SE, SW, W
"5e" : [1,1,0,1,0,1,0,1], # N, NE, SE, SW, NW
"6a" : [1,1,1,1,1,1,0,0], # N, NE, E, SE, S, SW
"6c" : [1,1,1,1,1,0,1,0], # N, NE, E, SE, S, W
"6k" : [1,1,1,1,0,1,1,0], # N, NE, E, SE, SW, W
"6e" : [1,1,1,1,0,1,0,1], # N, NE, E, SE, SW, NW
"6n" : [1,1,1,0,1,1,1,0], # N, NE, E, S, SW, W
"6i" : [1,1,0,1,1,1,0,1], # N, NE, SE, S, SW, NW
"7c" : [1,1,1,1,1,1,1,0], # N, NE, E, SE, S, SW, W
"7e" : [1,1,1,1,1,1,0,1], # N, NE, E, SE, S, SW, NW
"8" : [1,1,1,1,1,1,1,1], # N, NE, E, SE, S, SW, W, NW
}
allneighbours = [
["0"],
["1e", "1c"],
["2a", "2e", "2k", "2i", "2c", "2n"],
["3a", "3n", "3r", "3q", "3j", "3i", "3e", "3k", "3y", "3c"],
["4a", "4r", "4q", "4i", "4y", "4k", "4n", "4z", "4j", "4t", "4w", "4e", "4c"],
["5i", "5j", "5n", "5a", "5q", "5c", "5r", "5y", "5k", "5e"],
["6a", "6c", "6k", "6e", "6n", "6i"],
["7c", "7e"],
["8"],
]
allneighbours_flat = [n for x in allneighbours for n in x]
numneighbours = len(notationdict)
# Use dict to store rule elements, initialised by setrule():
bee = {}
ess = {}
alphanumeric = ""
rulename = ""
# Save the isotropic rule
def saveAllRules(self):
self.saveIsotropicRule()
# Interpret birth or survival string
def ruleparts(self, part):
inverse = False
nlist = []
totalistic = True
rule = { k: False for k, v in self.notationdict.iteritems() }
# Reverse the rule string to simplify processing
part = part[::-1]
for c in part:
if c.isdigit():
d = int(c)
if totalistic:
# Add all the neighbourhoods for this value
for neighbour in self.allneighbours[d]:
rule[neighbour] = True
elif inverse:
# Add all the neighbourhoods not in nlist for this value
for neighbour in self.allneighbours[d]:
if neighbour[1] not in nlist:
rule[neighbour] = True
else:
# Add all the neighbourhoods in nlist for this value
for n in nlist:
neighbour = c + n
if neighbour in rule:
rule[neighbour] = True
else:
# Error
return {}
inverse = False
nlist = []
totalistic = True
elif (c == '-'):
inverse = True
else:
totalistic = False
nlist.append(c)
return rule
# Set isotropic, non-totalistic rule
# Adapted from Eric Goldstein's HenselNotation->Ruletable(1.3).py
def setrule(self, rulestring):
# neighbours_flat = [n for x in neighbours for n in x]
b = {}
s = {}
sep = ''
birth = ''
survive = ''
rulestring = rulestring.lower()
if '/' in rulestring:
sep = '/'
elif '_' in rulestring:
sep = '_'
elif (rulestring[0] == 'b'):
sep = 's'
else:
sep = 'b'
survive, birth = rulestring.split(sep)
if (survive[0] == 'b'):
survive, birth = birth, survive
survive = survive.replace('s', '')
birth = birth.replace('b', '')
b = self.ruleparts(birth)
s = self.ruleparts(survive)
if b and s:
self.alphanumeric = 'B' + birth + 'S' + survive
self.rulename = 'B' + birth + '_S' + survive
self.bee = b
self.ess = s
else:
# Error
g.note("Unable to process rule definition.\n" +
"b = " + str(b) + "\ns = " + str(s))
g.exit()
# Save a rule file:
def saverule(self, name, comments, table, colours):
ruledir = g.getdir("rules")
filename = ruledir + name + ".rule"
results = "@RULE " + name + "\n\n"
results += "*** File autogenerated by saverule. ***\n\n"
results += comments
results += "\n\n@TABLE\n\n"
results += table
results += "\n\n@COLORS\n\n"
results += colours
results += "\n\n@ICONS\n\n"
results += "circles\n"
# Only create a rule file if it doesn't already exist; this avoids
# concurrency issues when booting an instance of apgsearch whilst
# one is already running.
if not os.path.exists(filename):
try:
f = open(filename, 'w')
f.write(results)
f.close()
except:
g.warn("Unable to create rule table:\n" + filename)
# Defines a variable:
def newvar(self, name, vallist):
line = "var "+name+"={"
for i in xrange(len(vallist)):
if (i > 0):
line += ','
line += str(vallist[i])
line += "}\n"
return line
# Defines a block of equivalent variables:
def newvars(self, namelist, vallist):
block = "\n"
for name in namelist:
block += self.newvar(name, vallist)
return block
def scoline(self, chara, charb, left, right, amount):
line = str(left) + ","
for i in xrange(8):
if (i < amount):
line += chara
else:
line += charb
line += chr(97 + i)
line += ","
line += str(right) + "\n"
return line
def isotropicline(self, chara, charb, left, right, n):
line = str(left) + ","
neighbours = self.notationdict[n]
for i in xrange(8):
if neighbours[i]:
line += chara
else:
line += charb
line += chr(97 + i)
line += ","
line += str(right) + "\n"
return line
def saveIsotropicRule(self):
comments = """
This is a two state, isotropic, non-totalistic rule on the Moore neighbourhood.
The notation used to define the rule was originally proposed by Alan Hensel.
See http://www.ibiblio.org/lifepatterns/neighbors2.html for details
"""
table = """
n_states:2
neighborhood:Moore
symmetries:rotate4reflect
"""
table += self.newvars(["a","b","c","d","e","f","g","h"], [0, 1])
table += "\n# Birth\n"
for n in self.allneighbours_flat:
if self.bee[n]:
table += "0,"
table += str(self.notationdict[n])[1:-1].replace(' ','')
table += ",1\n"
table += "\n# Survival\n"
for n in self.allneighbours_flat:
if self.ess[n]:
table += "1,"
table += str(self.notationdict[n])[1:-1].replace(' ','')
table += ",1\n"
table += "\n# Death\n"
table += self.scoline("","",1,0,0)
colours = ""
self.saverule(self.rulename, comments, table, colours)
rulestring = g.getstring("Enter rule string in Alan Hensel's isotropic rule notation",
"B2-a/S12")
rg = RuleGenerator()
rg.setrule(rulestring)
rg.saveIsotropicRule()
g.setrule(rg.rulename)
g.show("Created rule in file: " + rg.rulename + ".rule")
One thing worth noting is that a hyphen (aka minus sign) in a rule name has the potential to cause minor confusion. From the "Related rules can share colors and/or icons" section in Help > File Formats:dvgrn wrote:Anyway, this isotropic-rule-gen.py seems to work fine as far as I can see. What am I missing?
Code: Select all
@RULE GreyGrey
@TABLE
n_states:3
neighborhood:Moore
symmetries:permute
var a={0,1,2}
var b={0,1,2}
var aa=a
var ab=a
var ac=a
var ad=a
var ae=a
var af=a
var ag=a
var o={0,2}
var oa=o
var ob=o
var oc=o
var od=o
var oe=o
var of=o
var og=o
0,1,1,1,o,oa,ob,oc,od,1
0,1,1,1,1,1,1,1,0,2
0,1,1,1,1,1,1,0,0,2
0,1,1,1,1,0,0,0,0,2
2,1,1,0,0,0,0,0,0,1
1,a,o,oa,ob,oc,od,oe,of,0
1,1,1,1,1,a,aa,ab,ac,0
1,2,a,aa,ab,ac,ad,ae,af,0
2,1,1,1,1,1,1,a,b,0
2,1,1,1,1,1,a,b,aa,0
2,1,1,1,1,a,b,aa,ab,0
2,1,1,1,a,b,aa,ab,ac,0
2,2,2,2,a,b,aa,ab,ac,0
2,0,0,0,0,0,0,0,0,1
@COLORS
0 0 0 0
1 255 255 255
2 100 100 100
Code: Select all
x = 42, y = 6, rule = GreyGrey
16.AB21.A$.B2A12.A2.A7.BA10.A$A2.A12.A2.A6.A2.A7.3A$3A15.BA6.A2.A7.2A
2.B$27.BA8.2A.B$39.B!
That seems like a nice clean simple way to dodge the problem. I've edited the script posted above to version 1.1, so it now writes an @ICONS section.Andrew wrote:EDIT #2: An easy way to avoid the problem is just to add an @ICONS section (followed by a line with "circles"). Your script already adds @COLORS. If both sections are present then Golly won't attempt the "-shared" search.
B2-k/S0 has a lot more interesting things, but still explodesmuzik wrote:What about a rule where light speed ships exist but patterns don't explode like crazy like in Seeds?
viewtopic.php?f=11&t=803&start=85muzik wrote:What about a rule where light speed ships exist but patterns don't explode like crazy like in Seeds?
The spaceship's 2c/5.Saka wrote:A modification of GreyLifeSixAnd it has a c3 and oscillators that are dependentCode: Select all
GreyGrey.rule
Code: Select all
rle
nice, but are there any ships slower than c?A for awesome wrote:viewtopic.php?f=11&t=803&start=85muzik wrote:What about a rule where light speed ships exist but patterns don't explode like crazy like in Seeds?
There are B0 rules where ships can move at lightspeed diagonally. Having a spaceship move faster than lightspeed in a radius 1 outer-totalistic rule in any direction is completely impossible, because no information can travel faster than that - each cell only can influence its neighbors on a given generation, and that information transfer is defined as 'lightspeed'.muzik wrote:Also, are there any non-explosive rules (or rules in general) where a ship can travel at light speed diagonal, or faster than light speed on any direction? Non explosive preferred
Then what about rules that influence cells not immediately adjacent to existing cells? Can golly even run those?Sphenocorona wrote:There are B0 rules where ships can move at lightspeed diagonally. Having a spaceship move faster than lightspeed in a radius 1 outer-totalistic rule in any direction is completely impossible, because no information can travel faster than that - each cell only can influence its neighbors on a given generation, and that information transfer is defined as 'lightspeed'.muzik wrote:Also, are there any non-explosive rules (or rules in general) where a ship can travel at light speed diagonal, or faster than light speed on any direction? Non explosive preferred
The variant you want already exists, though it doesn't have a convenient rule that can just be copied directly into Golly.muzik wrote:I'd like a LifeHistory variant with two new cells
I guess I have no hope then, I'm on the mobile version which has limitations.Sphenocorona wrote:The variant you want already exists, though it doesn't have a convenient rule that can just be copied directly into Golly.muzik wrote:I'd like a LifeHistory variant with two new cells
Here:muzik wrote:But can a version of that be adapted into a regular rule file?
Code: Select all
@RULE extendedlife
@TABLE
n_states:7
neighborhood:Moore
symmetries:permute
# General Behavior:
#
# 0 is empty
# 1 is on
# 2 is birthforcer
# 3 is deathforcer
# 4 is birthforcer + deathforcer
# 5 is blocker
# 6 is reactor
#
# Specific Behavior
# 0 changes to 1 when (state1 neighbors + state6 neighbors) == 3
# 0 changes to 1 when (state2 neighbors + state4 neighbors) >= 1
# otherwise 0 stays 0
#
# 1 changes to 0 when (state1 neighbors + state6 neighbors) != 2, 3
# 1 changes to 0 when (state3 neighbors + state4 neighbors) >= 1
# otherwise 1 stays 1
#
# 2 always stays 2
#
# 3 always stays 3
#
# 4 always stays 4
#
# 5 always stays 5
#
# 6 always stays 6
var a={2,4}
var b={0,1,2,3,4,5,6}
var c={b}
var d={b}
var e={b}
var f={b}
var g={b}
var h={b}
var i={1,6}
var j={i}
var k={i}
var L={i}
var m={i}
var n={i}
var o={i}
var p={i}
var q={0,2,3,4,5}
var r={q}
var s={q}
var t={q}
var u={q}
var v={q}
var w={q}
var x={q}
var y={3,4}
# 0 birthforcer
0,a,b,c,d,e,f,g,h,1
# 0 normal birth
0,i,j,k,q,r,s,t,u,1
# 1 deathforcer
1,y,b,c,d,e,f,g,h,0
# 1 normal death
1,q,r,s,t,u,v,w,x,0
1,i,r,s,t,u,v,w,x,0
1,i,j,k,L,u,v,w,x,0
1,i,j,k,L,m,v,w,x,0
1,i,j,k,L,m,n,w,x,0
1,i,j,k,L,m,n,o,x,0
1,i,j,k,L,m,n,o,p,0
@COLORS
0 0 0 0
1 255 255 0
2 0 255 0
3 0 0 255
4 0 255 255
5 153 153 153
6 255 255 128