Re: Rule request thread
Posted: March 5th, 2025, 3:52 pm
Life, but cells that are born by b3n cannot survive by s2k in the first generation they are alive. that's literally it.
get_Snacked wrote: March 5th, 2025, 3:52 pm Life, but cells that are born by b3n cannot survive by s2k in the first generation they are alive. that's literally it.
Code: Select all
#C [[ RANDOMIZE2 RANDWIDTH 320 RANDHEIGHT 240 RANDFILL 25 ]]
x = 1, y = 1, rule = TestingRequestFromPost205978
b!
@RULE TestingRequestFromPost205978
https://conwaylife.com/forums/viewtopic.php?p=205978#p205978
Living = state 1 or state 2
@TABLE
n_states:3
neighborhood:Moore
symmetries:rotate4reflect
var a={1,2}
var b=a
var c=a
var d=a
var p={0,1,2}
var q=p
var r=p
var s=p
var t=p
var u=p
var v=p
var w=p
# If a cell's condition is (S2k|D2k) in the current generation
# and the cell's condition was (B3n|A3n) in the preceding generation,
# then the cell dies:
2, a,0,0,b,0,0,0,0, 0
# the rules implementing birth from =3 alive neighbours:
0, a,b,c,0,0,0,0,0, 1
0, a,b,0,c,0,0,0,0, 2 # B3n
0, a,b,0,0,c,0,0,0, 1
0, a,b,0,0,0,c,0,0, 1
0, a,b,0,0,0,0,c,0, 1
0, a,b,0,0,0,0,0,c, 1
0, a,0,b,0,c,0,0,0, 1
0, a,0,b,0,0,c,0,0, 1
0, 0,a,0,b,0,c,0,0, 1
0, 0,a,0,b,0,0,c,0, 1
# the rules implementing survival with =3 alive neighbours:
d, a,b,c,0,0,0,0,0, 1
d, a,b,0,c,0,0,0,0, 1
d, a,b,0,0,c,0,0,0, 1
d, a,b,0,0,0,c,0,0, 1
d, a,b,0,0,0,0,c,0, 1
d, a,b,0,0,0,0,0,c, 1
d, a,0,b,0,c,0,0,0, 1
d, a,0,b,0,0,c,0,0, 1
d, 0,a,0,b,0,c,0,0, 1
d, 0,a,0,b,0,0,c,0, 1
# the rules implementing survival with =2 alive neighbours:
d, a,b,0,0,0,0,0,0, 1
d, a,0,b,0,0,0,0,0, 1
d, a,0,0,b,0,0,0,0, 1
d, a,0,0,0,b,0,0,0, 1
d, 0,a,0,b,0,0,0,0, 1
d, 0,a,0,0,0,b,0,0, 1
d, p,q,r,s,t,u,v,w, 0 # otherwise, everything becomes zero
Code: Select all
@TABLE
n_states:7
neighborhood:vonNeumann
symmetries:permute
var a = {0,1,2,3,4,5,6}
var b = a
var c = a
var d = a
var x = {1,2}
var y = {3,4}
var z = {5,6}
x,6,a,b,c,2
y,2,a,b,c,4
z,4,a,b,c,6
2,a,b,c,d,1
4,a,b,c,d,3
6,a,b,c,d,5Code: Select all
x = 14, y = 2, rule = TestingPost207257_Crawler
5.C7.I$BA!
#C [[ GRID ]]
@RULE TestingPost207257_Crawler
0 = background/dead cells
1 = crawler; photon head (the tail is 2)
2 = crawler tail
3 = wall
4 = turner; with 0,1,3 walls/objects around it bounces crawlers; with two walls/objects in a specific configuration it turns crawlers 90 degrees; with 4-8 walls/objects around it becomes a wall.
5 = filter; turns crawlers into walls.
6 = plant; turns walls into crawlers and bounces them off.
7 = box; can be pushed by crawlers, can be turned into wall using eaters [???], and can also interact with turners.
8 = black hole; every nonzero neighbour becomes a black hole
9 = dissolver; turns every neighbouring non-dissolver into background
10 = replicator, replicates everything and puts the copy on the opposite side of it
@NAMES
0 background
1 crawler
2 crawler tail
3 wall
4 turner
5 filter
6 plant
7 box
8 black hole
9 dissolver
10 replicator
@COLORS
0 240 240 240
1 240 120 40
2 240 180 40
3 80 80 80
4 40 40 240
5 240 40 40
6 40 240 40
7 180 180 40
8 40 40 40
9 80 80 240
10 140 140 40
@TABLE
n_states:11
neighborhood:Moore
symmetries:rotate4reflect
var safe_background_for_crawler={0,3}
var sbfc1=safe_background_for_crawler
var sbfc2=safe_background_for_crawler
var sbfc3=safe_background_for_crawler
var sbfc4=safe_background_for_crawler
var sbfc5=safe_background_for_crawler
var sbfc6=safe_background_for_crawler
var sbfc7=safe_background_for_crawler
var anything={0,1,2,3,4,5,6,7,8,9,10}
var n=anything
var r=anything
var e=anything
var h=anything
var s=anything
var v=anything
var w=anything
var l=anything
# The above lines defined some variables. Those variables can now be used in the rules listed below.
# The rules are read one-by-one, line-by-line, from top to down. The first "matching" rule applies.
# The following three rules tell that, if there is an adjacent "dissolver" (9),
# then a non-"dissolver" (anything /= 9) becomes background (0),
# and a "dissolver" adjacent to another "dissolver" remains unchanged.
# Note that the first "matching" rule applies, which is important in this case:
9, n,r,e,h,s,v,w,l, 9 # a "dissolver" remains unchanged
anything, 9,r,e,h,s,v,w,l, 0 # anything else -> 0 when there's an orthogonally adjacent 9
anything, n,9,e,h,s,v,w,l, 0 # anything else -> 0 when there's a diagonally adjacent 9
# The following rule allows the crawler to move orthogonally:
0, 1,sbfc1,sbfc2,sbfc3,sbfc4,sbfc5,sbfc6,sbfc7, 1
# The following rule tells that the "crawler" (1) always decays into "crawler tail" (2):
1, n,r,e,h,s,v,w,l, 2 # crawler -> crawler tail
# The following rule tells that the "crawler tail" (2) always decays into "background" (0):
2, n,r,e,h,s,v,w,l, 0 # crawler -> background
Vlev2 wrote: March 17th, 2025, 9:57 pm I name this rule uhhh
i don't know what to name it, oh wait i should name it crawler (without s, crawlers is taken)
the rule is a multistate colorized rule that can be used for wiring.
States
The first state is just white background/dead cells.
The second state is crawler, which is an orange state. it is a photon (c/1 spaceship) that makes up the simplest spaceship (the crawler) which is 2 cells. it also gains support from the second state, the crawler tail (or tail). it does not need a wire to move, it works perfect in vacuum. it cannot move diagonally. it decays into the tail.
The third state is the tail (crawler tail), which is light orange. it provides support to the crawler, and prevents it from blowing up into more crawlers. it always decays into background, unless it comes in contact with the black hole, which we will get to later.
The fourth state is called a wall, which is just a grey block that never gets destroyed, unless in contact with the black hole. crawler spaceships can go through tunnels of them, but if it crashes into a wall, it gets destroyed. if you want to turn it around in a wire (or wall tunnel), then use the 5th state, the turner.
the fifth state is... you guessed it, the turner. it is a cornflower blue cell that turns crawlers around 90°, but needs support from walls or objects around the edge (not corner) of it. if it has 0-1 walls or objects around it, it just bounces crawlers. with 2 walls or objects on the edge of it (or e2 in INT terms), it will function and turn things 90°. if it has 3 cells around it, it bounces stuff again. with 4-8 cells around the edge of it, it becomes wall.
the sixth state is the filter, a light red (or salmon) part that turns crawlers into walls. that's all it really does. the seventh state, the plant is the polar opposite, which is light green in color and brings walls back to life turning then into crawlers and bouncing them off.
the eighth state is the box, a light brown cell that can be pushed by crawlers. can be turned into wall using eaters, and can also interact with turners.
the ninth state is the black hole, a black part which turns every touching part (except other black holes) into a black hole. they can also be joined together with other black holes. can also be used to move black holes, destroying the touching black hole while becoming one.
the tenth state is the dissolver, a grayish blue cell which turns every part it touches (except for other dissolvers) into background.
the eleventh (and final state) is the replicator, a dark yellow cell that replicates everything (except for walls, black holes, and dissolvers) and puts the copy on the opposite side of it, and cannot replicate if a part is already behind it
i hope this rule isn't too hard to make, but good luck! :)
Does this work as intended?PiSpaceships wrote: March 19th, 2025, 1:11 pm Make a Golly script that takes birth and survival conditions in INT format and returns the following 3-state rule:
-A cell is born in state 2 if it satisfy one of the birth conditions, checking only state 1 cells.
-A cell in state 2 turns into state 1 if it satisfy one of the survival conditons, checking only state 2 cells. Else, it dies.
-State 1 cell always dies.
So like Bb/S|B/Ss alternating rules, but patterns from otherwise uncompatible generations can coexist.
Code: Select all
x = 13, y = 12, rule = Testing_B1S1
11.AB$6.3B.B.B$6.B.B.A2B$6.A2$4.2BA2.B2$BA4.A$B.B$2BA2$5.B.3B!
@RULE Testing_B1S1
https://conwaylife.com/forums/viewtopic.php?p=207405#p207405
@TABLE
n_states:3
neighborhood:Moore
symmetries:none
var a1={0,2}
var a2={0,2}
var a3={0,2}
var a4={0,2}
var a5={0,2}
var a6={0,2}
var a7={0,2}
var a8={0,2}
var b1={0,1}
var b2={0,1}
var b3={0,1}
var b4={0,1}
var b5={0,1}
var b6={0,1}
var b7={0,1}
var b8={0,1}
var x1={0,1,2}
var x2={0,1,2}
var x3={0,1,2}
var x4={0,1,2}
var x5={0,1,2}
var x6={0,1,2}
var x7={0,1,2}
var x8={0,1,2}
0, a1,a2,a3,1,a5,a6,a7,a8, 2
2, b1,b2,b3,2,b5,b6,b7,b8, 1
0, a1,a2,a3,a4,1,a6,a7,a8, 2
2, b1,b2,b3,b4,2,b6,b7,b8, 1
0, a1,a2,a3,a4,a5,1,a7,a8, 2
2, b1,b2,b3,b4,b5,2,b7,b8, 1
0, a1,a2,1,a4,a5,a6,a7,a8, 2
2, b1,b2,2,b4,b5,b6,b7,b8, 1
0, a1,a2,a3,a4,a5,a6,1,a8, 2
2, b1,b2,b3,b4,b5,b6,2,b8, 1
0, a1,1,a3,a4,a5,a6,a7,a8, 2
2, b1,2,b3,b4,b5,b6,b7,b8, 1
0, 1,a2,a3,a4,a5,a6,a7,a8, 2
2, 2,b2,b3,b4,b5,b6,b7,b8, 1
0, a1,a2,a3,a4,a5,a6,a7,1, 2
2, b1,b2,b3,b4,b5,b6,b7,2, 1
1, x1,x2,x3,x4,x5,x6,x7,x8, 0
2, x1,x2,x3,x4,x5,x6,x7,x8, 0
Code: Select all
x = 20, y = 9, rule = Testing_B234S23
14.3B$13.B3.B$2.3A7.B.B3.B$.A3.A7.2B2.B$A5.A4.3B.2B.2B$5.A7.B.B$3A3.A
9.3B2$2A!
@RULE Testing_B234S23
https://conwaylife.com/forums/viewtopic.php?p=207405#p207405
@TABLE
n_states:3
neighborhood:Moore
symmetries:none
var a1={0,2}
var a2={0,2}
var a3={0,2}
var a4={0,2}
var a5={0,2}
var a6={0,2}
var a7={0,2}
var a8={0,2}
var b1={0,1}
var b2={0,1}
var b3={0,1}
var b4={0,1}
var b5={0,1}
var b6={0,1}
var b7={0,1}
var b8={0,1}
var x1={0,1,2}
var x2={0,1,2}
var x3={0,1,2}
var x4={0,1,2}
var x5={0,1,2}
var x6={0,1,2}
var x7={0,1,2}
var x8={0,1,2}
0, a1,a2,a3,1,1,a6,a7,a8, 2
2, b1,b2,b3,2,2,b6,b7,b8, 1
0, a1,a2,a3,1,a5,1,a7,a8, 2
2, b1,b2,b3,2,b5,2,b7,b8, 1
0, a1,a2,a3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 2
1, x1,x2,x3,x4,x5,x6,x7,x8, 0
2, x1,x2,x3,x4,x5,x6,x7,x8, 0
Code: Select all
# Requested in https://conwaylife.com/forums/viewtopic.php?p=207405#p207405
import golly as g
import itertools as it
SCRIPT_NAME = '?p=207405#p207405'
def iter_celllist(celllist):
epc = 2 + (len(celllist) % 2)
for i in range(len(celllist) // epc):
x = celllist[epc * i + 0]
y = celllist[epc * i + 1]
c = 1
if epc == 3:
c = celllist[epc * i + 2]
yield x, y, c
# Follow the rules of a two-state CA currently active in Golly
def slowcalc2(nw, n, ne, w, c, e, sw, s, se):
celllist = [ -1, -1, nw,
0, -1, n,
1, -1, ne,
-1, 0, w,
0, 0, c,
1, 0, e,
-1, 1, sw,
0, 1, s,
1, 1, se,
]
assert len(celllist) % 2 == 1
for x, y, c in iter_celllist(g.evolve(celllist, 1)):
if x == y == 0:
return c
return 0
def looks_like_valid_name(s):
A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
B = '0123456789_-'
if not (0 < len(s) < 128):
return False
if s[0] not in A:
return False
if not set(s.upper()).issubset(A + B):
return False
return True
def make_rule(c, x, nrehsvwl, vn, vv):
r = '{}, '.format(c)
for i in range(8):
t = nrehsvwl[i]
if t == 0:
t = '{}{}'.format(vn, i + 1)
else:
t = '{}'.format(vv)
r += '{},'.format(t)
r += ' {}\n'.format(x)
return r
def main():
if g.numstates() != 2:
g.show('Before running the script, make sure that the current CA is two-state.')
return
nm = 'Testing_' + g.getrule().replace('/', '')
if not looks_like_valid_name(nm):
nm = 'Testing'
nm = g.getstring('Enter the name:', nm, SCRIPT_NAME)
if not looks_like_valid_name(nm):
g.show('The input does not look like a valid name.')
return
with open(g.getdir('rules') + nm + '.rule', mode='w') as f:
f.write('@RULE {}\n\n'.format(nm))
f.write('https://conwaylife.com/forums/viewtopic.php?p=207405#p207405')
f.write('\n\n@TABLE\n')
f.write('n_states:3\nneighborhood:Moore\nsymmetries:none\n\n')
for i in range(1, 9):
f.write('var a{}={}\n'.format(i, '{0,2}'))
for i in range(1, 9):
f.write('var b{}={}\n'.format(i, '{0,1}'))
for i in range(1, 9):
f.write('var x{}={}\n'.format(i, '{0,1,2}'))
f.write('\n')
for nw, n, ne, w, e, sw, s, se in it.product(range(2), repeat = 8):
nrehsvwl = (n, ne, e, se, s, sw, w, nw)
if slowcalc2(nw, n, ne, w, 0, e, sw, s, se) > 0:
f.write(make_rule(0, 2, nrehsvwl, 'a', 1))
if slowcalc2(nw, n, ne, w, 1, e, sw, s, se) > 0:
f.write(make_rule(2, 1, nrehsvwl, 'b', 2))
f.write('1, x1,x2,x3,x4,x5,x6,x7,x8, 0\n')
f.write('2, x1,x2,x3,x4,x5,x6,x7,x8, 0\n')
g.setrule(nm)
main()
Sorry, but islptng already made it, and it's better:confocaloid wrote: March 20th, 2025, 8:42 amDoes this work as intended?PiSpaceships wrote: March 19th, 2025, 1:11 pm Make a Golly script that takes birth and survival conditions in INT format and returns the following 3-state rule:
-A cell is born in state 2 if it satisfy one of the birth conditions, checking only state 1 cells.
-A cell in state 2 turns into state 1 if it satisfy one of the survival conditons, checking only state 2 cells. Else, it dies.
-State 1 cell always dies.
So like Bb/S|B/Ss alternating rules, but patterns from otherwise uncompatible generations can coexist.
For some reason, the long link currently doesn't load for me. Does it give a Golly script that can be run in Golly? Does it work equivalently to what I wrote?PiSpaceships wrote: March 20th, 2025, 8:47 am [...] Sorry, but islptng already made it, and it's better: [...]
It isn't a Golly script, but it's an online Python program that takes the INT rulestring and returns the ruletable. It works by turning the rulestring into two lists of conditions - birth and survival - and next tuening each condition into a row in the ruletable.confocaloid wrote: March 20th, 2025, 8:52 amFor some reason, the long link currently doesn't load for me. Does it give a Golly script that can be run in Golly? Does it work equivalently to what I wrote?PiSpaceships wrote: March 20th, 2025, 8:47 am [...] Sorry, but islptng already made it, and it's better: [...]
Unfortunately for some reason it currently doesn't load for me, so I cannot check whether it produces equivalent rules to what my script gives.PiSpaceships wrote: March 20th, 2025, 9:05 am [...] It isn't a Golly script, but it's an online Python program that takes the INT rulestring and returns the ruletable. It works by turning the rulestring into two lists of conditions - birth and survival - and next tuening each condition into a row in the ruletable.
Code: Select all
import golly as gl
rule = gl.getrule()
if gl.getalgo() not in ["QuickLife","HashLife"]:
gl.exit("Unsupported rule.")
if rule[-1] in "HV":
gl.exit("Unsupported neighborhood.")
Hensel = {
"0" : [0,0,0,0,0,0,0,0],
"1e" : [1,0,0,0,0,0,0,0],
"1c" : [0,1,0,0,0,0,0,0],
"2a" : [1,1,0,0,0,0,0,0],
"2e" : [1,0,1,0,0,0,0,0],
"2k" : [1,0,0,1,0,0,0,0],
"2i" : [1,0,0,0,1,0,0,0],
"2c" : [0,1,0,1,0,0,0,0],
"2n" : [0,1,0,0,0,1,0,0],
"3a" : [1,1,1,0,0,0,0,0],
"3n" : [1,1,0,1,0,0,0,0],
"3r" : [1,1,0,0,1,0,0,0],
"3q" : [1,1,0,0,0,1,0,0],
"3j" : [1,1,0,0,0,0,1,0],
"3i" : [1,1,0,0,0,0,0,1],
"3e" : [1,0,1,0,1,0,0,0],
"3k" : [1,0,1,0,0,1,0,0],
"3y" : [1,0,0,1,0,1,0,0],
"3c" : [0,1,0,1,0,1,0,0],
"4a" : [1,1,1,1,0,0,0,0],
"4r" : [1,1,1,0,1,0,0,0],
"4q" : [1,1,1,0,0,1,0,0],
"4i" : [1,1,0,1,1,0,0,0],
"4y" : [1,1,0,1,0,1,0,0],
"4k" : [1,1,0,1,0,0,1,0],
"4n" : [1,1,0,1,0,0,0,1],
"4z" : [1,1,0,0,1,1,0,0],
"4j" : [1,1,0,0,1,0,1,0],
"4t" : [1,1,0,0,1,0,0,1],
"4w" : [1,1,0,0,0,1,1,0],
"4e" : [1,0,1,0,1,0,1,0],
"4c" : [0,1,0,1,0,1,0,1],
"5i" : [1,1,1,1,1,0,0,0],
"5j" : [1,1,1,1,0,1,0,0],
"5n" : [1,1,1,1,0,0,1,0],
"5a" : [1,1,1,1,0,0,0,1],
"5q" : [1,1,1,0,1,1,0,0],
"5c" : [1,1,1,0,1,0,1,0],
"5r" : [1,1,0,1,1,1,0,0],
"5y" : [1,1,0,1,1,0,1,0],
"5k" : [1,1,0,1,0,1,1,0],
"5e" : [1,1,0,1,0,1,0,1],
"6a" : [1,1,1,1,1,1,0,0],
"6c" : [1,1,1,1,1,0,1,0],
"6k" : [1,1,1,1,0,1,1,0],
"6e" : [1,1,1,1,0,1,0,1],
"6n" : [1,1,1,0,1,1,1,0],
"6i" : [1,1,0,1,1,1,0,1],
"7c" : [1,1,1,1,1,1,1,0],
"7e" : [1,1,1,1,1,1,0,1],
"8" : [1,1,1,1,1,1,1,1]}
def RuleFormat(rulestr):
HenselInFun = [['0x'], ['1c', '1e'], ['2a', '2c', '2e', '2i', '2k', '2n'],
['3a', '3c', '3e', '3i', '3j', '3k', '3n', '3q', '3r', '3y'],
['4a', '4c', '4e', '4i', '4j', '4k', '4n', '4q', '4r', '4t', '4w', '4y', '4z'],
['5a', '5c', '5e', '5i', '5j', '5k', '5n', '5q', '5r', '5y'],
['6a', '6c', '6e', '6i', '6k', '6n'], ['7c', '7e'], ['8x']]
HENSEL = [
['0'], ['1c', '1e'], ['2a', '2c', '2e', '2i', '2k', '2n'],
['3a', '3c', '3e', '3i', '3j', '3k', '3n', '3q', '3r', '3y'],
['4a', '4c', '4e', '4i', '4j', '4k', '4n', '4q', '4r', '4t', '4w', '4y', '4z'],
['5a', '5c', '5e', '5i', '5j', '5k', '5n', '5q', '5r', '5y'],
['6a', '6c', '6e', '6i', '6k', '6n'], ['7c', '7e'], ['8']]
rulestr = rulestr.split("/S")
birth = rulestr[0][1:].replace("8","8x")
survival = rulestr[1].replace("0","0x").replace("8","8x")
def ConditionsFormat(cstr):
res = ""
currentnum = -1
negated = False
letterslist = []
for supercalifragilisticexpialidocious in range(len(cstr) + 1):
try:
i = cstr[supercalifragilisticexpialidocious]
except: i = "9"
if i in "0123456789":
if currentnum != -1:
if len(letterslist) == 0:
letterslist = [x[1] for x in HENSEL[currentnum]]
if negated:
newlist = []
for j in HENSEL[currentnum]:
if j[1] not in letterslist:
newlist.append(j[1])
letterslist = newlist
for j in letterslist:
res += str(currentnum) + j
currentnum = int(i)
negated = False
letterslist = []
elif i == "-": negated = True
else: letterslist.append(i)
return res.replace("x","")
return (ConditionsFormat(birth),ConditionsFormat(survival))
template = '''@RULE Test
** File auto generated **
@TABLE
n_states:3
neighborhood:Moore
symmetries:rotate4reflect
var a = {0,1,2}
var b = a
var c = a
var d = a
var e = a
var f = a
var g = a
var h = a
var i = a
var n1_0 = {0,2}
var n1_1 = n1_0
var n1_2 = n1_0
var n1_3 = n1_0
var n1_4 = n1_0
var n1_5 = n1_0
var n1_6 = n1_0
var n1_7 = n1_0
var n2_0 = {0,1}
var n2_1 = n2_0
var n2_2 = n2_0
var n2_3 = n2_0
var n2_4 = n2_0
var n2_5 = n2_0
var n2_6 = n2_0
var n2_7 = n2_0
<content>
a,b,c,d,e,f,g,h,i,0'''
def ctrule(rulestring):
b,s = RuleFormat(rulestring)
res = ""
for i in Hensel:
j = ",".join([(("x" if Hensel[i][x] else "y")+str(x)) for x in range(len(Hensel[i]))])
if i in b: res += "0,"+j.replace("x","1-").replace("y","n1_")+",2\n"
if i in s: res += "2,"+j.replace("x","2-").replace("y","n2_")+",1\n"
for i in range(8):
res = res.replace("-"+str(i),"")
return template.replace("<content>",res)
rules = gl.getdir("rules")
rules += "Test.rule"
with open(rules,mode="w") as wf: print(ctrule(rule), file=wf)
g.setrule("Test")
I had to change the parts that are left in the above quote (the omitted parts are left intact).islptng wrote: March 20th, 2025, 4:23 pm It can be made into a Golly script easily:Code: Select all
[...][...][...] template = '''@RULE test [...][...][...] rules = gl.getdir("rules") if rules[-1] != "\\": rules += "\\" rules += "test.rule" with open(rules) as wf: print(ctrule(rule), file=wf)
Code: Select all
rules = gl.getdir("rules")
rules += "Test.rule"
with open(rules, mode="w") as wf: print(ctrule(rule), file=wf)
gl.setrule("Test")
Because it's guaranteed to be terminated correctly, you shouldn't need to insert any path separators yourself. (In fact, the line inserting '\\' caused an error for me, the script didn't work at all.)In each case a full path is returned, terminated by the appropriate path separator for the current platform.
You didn't clarify what the transition rules does this rule feature.PiSpaceships wrote: March 22nd, 2025, 1:51 pm Make a 3-state rule that has very common small ogreship.
Ogreship is a spaceship which every n generations moves 1 cell in one direction and 10 cells in another.unname4798 wrote: March 22nd, 2025, 1:53 pm What is an ogreship?You didn't clarify what the transition rules does this rule feature.PiSpaceships wrote: March 22nd, 2025, 1:51 pm Make a 3-state rule that has very common small ogreship.
I used to play Go fairly regularly, thirty years or so ago. It's a great game.
For an extreme case, there would be absolutely no way for the rule to know what the new state of the board should be, after just a single generation -- because of lightspeed limitations.LittleLWSS wrote: March 29th, 2025, 7:51 amWhen the players placed their piece, go forward a generation.
Code: Select all
x = 21, y = 21, rule = B3-jknr4ity5ijk6i8/S23-a4city6c7cHistory
21F$F18ABF$FA16BABF$FAB14ABABF$FABA12BABABF$FABAB10ABABABF$FABABA8BAB
ABABF$FABABAB6ABABABABF$FABABABA4BABABABABF$FABABABAB2ABABABABABF$FAB
ABABABADBABABABABF$FABABABABA2BABABABABF$FABABABAB4ABABABABF$FABABABA
6BABABABF$FABABAB8ABABABF$FABABA10BABABF$FABAB12ABABF$FABA14BABF$FAB
16ABF$FA18BF$21F!Code: Select all
x = 1, y = 1, rule = B2o34p56/S2o3-m4p56H
b!Code: Select all
#R B2a/S12kn
!
[[ RANDOMIZE ]]
Code: Select all
#R B34/S34
!
[[ RANDOMIZE ]]
Code: Select all
x = 16, y = 16, rule = 045678/2-a345678/5
A.A.4A3.2A.2A$4A4.3A.A.A$A.A.A.4A.4A$2.2A2.6A.A.A$A.5A.A4.A$2.A.A.2A.
3A$2.2A2.3A3.4A$A.3A.A.A.A2.2A$4A4.2A3.2A$2A2.4A.A.3A$A.A.A.A.5A.A$2A
2.A2.A.2A.A.2A$2A4.4A3.A.A$A.3A.A5.4A$A.2A4.2A.A2.A$3.3A3.2A.A.2A!
Code: Select all
x = 16, y = 16, rule = 045678/2345678/5
A.A.4A3.2A.2A$4A4.3A.A.A$A.A.A.4A.4A$2.2A2.6A.A.A$A.5A.A4.A$2.A.A.2A.
3A$2.2A2.3A3.4A$A.3A.A.A.A2.2A$4A4.2A3.2A$2A2.4A.A.3A$A.A.A.A.5A.A$2A
2.A2.A.2A.A.2A$2A4.4A3.A.A$A.3A.A5.4A$A.2A4.2A.A2.A$3.3A3.2A.A.2A!
hotcrystal0 wrote: March 29th, 2025, 3:49 pm This isn't exactly a normal request, but I still feel like it goes here.
A pair of rules, where one has B2a and the other doesn't where the one with B2a is nonexplosive, but the one without B2a is explosive.