## Golly scripts

For scripts to aid with computation or simulation in cellular automata.
dvgrn
Moderator
Posts: 6454
Joined: May 17th, 2009, 11:00 pm
Contact:

### Re: Golly scripts

BlinkerSpawn wrote:Really only the X value was required, as it allowed me to drop line breaks: since they must appear every X cells, I dropped them and merged like blocks across the boundary.
I added the Y value simply for completeness' sake.
Are you saying I should drop this and try working with SOF instead? (Either way it's an excuse to learn Lua)
No, not necessarily -- SOF is "ASCII-compatible", storing things fairly efficiently in base 78. But it's pretty annoying to transfer via an HTML page, and for various reasons it never really caught on as a file format. This new incarnation of your idea doesn't even have to be case-sensitive, right?

It might be worth making the newline character optional, or replace it with an underscore or something, so that X7_Y7_I0BAEA3DA3CBACGCACABA2 would be valid, and object libraries could be stored in text files with one line per pattern (?).

Sequences of like letters (typically AAAAA...) are represented as A[some number] as in RLEs.
Always wished it was possible to do better compression in RLE by encoding repeats of groups of characters, not just single characters -- in this case something like [CY]99 for a long line of blinkers, or whatever. Theoretically that could really cut down on the encoded size of quite a few patterns -- puffers or glider guns with a long chunk of their output, signal-carrying wires, and so forth.

But it would be fairly painful to figure out what the canonical form of a pattern should be, so probably it's a lousy idea.

A for awesome
Posts: 1993
Joined: September 13th, 2014, 5:36 pm
Location: 0x-1
Contact:

### Re: Golly scripts

• Sequences of like letters (typically AAAAA...) are represented as A[some number] as in RLEs.
• If a block is longer than 25 cells, denote it as Z[block length].
How would this format represent something like this?:

Code: Select all

x = 56, y = 53, rule = B3/S23
56o2$56o2$56o2$56o2$56o2$56o2$56o2$56o2$56o2$56o2$56o2$56o2$56o2$56o2$
56o2$56o2$56o2$56o2$56o2$56o2$56o2$56o2$56o2$56o2$56o2$56o2$56o!
Is there a divider between the length of individual runs and the length of the run of runs, like Z56_53, or is it just Z56Z56Z56...[repeat this 49 more times]...Z56?
x₁=ηx
V ⃰_η=c²√(Λη)
K=(Λu²)/2
Pₐ=1−1/(∫^∞_t₀(p(t)ˡ⁽ᵗ⁾)dt)

$$x_1=\eta x$$
$$V^*_\eta=c^2\sqrt{\Lambda\eta}$$
$$K=\frac{\Lambda u^2}2$$
$$P_a=1-\frac1{\int^\infty_{t_0}p(t)^{l(t)}dt}$$

http://conwaylife.com/wiki/A_for_all

Aidan F. Pierce

Posts: 1950
Joined: November 8th, 2014, 8:48 pm
Location: Getting a snacker from R-Bee's

### Re: Golly scripts

dvgrn wrote:It might be worth making the newline character optional, or replace it with an underscore or something, so that X7_Y7_I0BAEA3DA3CBACGCACABA2 would be valid, and object libraries could be stored in text files with one line per pattern (?).

Sequences of like letters (typically AAAAA...) are represented as A[some number] as in RLEs.
Always wished it was possible to do better compression in RLE by encoding repeats of groups of characters, not just single characters -- in this case something like [CY]99 for a long line of blinkers, or whatever.
1) The newline character is optional; the actual script uses an underscore in its stead, but for different reasons.
2) I had the same concerns, and I agree that canonical forms might be weird, but looking back it might actually not be that hard to implement; I could simply use another loop to parse the code after the main loop outputs it.
A for awesome wrote:
• Sequences of like letters (typically AAAAA...) are represented as A[some number] as in RLEs.
• If a block is longer than 25 cells, denote it as Z[block length].
How would this format represent something like this?:

Code: Select all

stripes
Is there a divider between the length of individual runs and the length of the run of runs, like Z56_53, or is it just Z56Z56Z56...[repeat this 49 more times]...Z56?
My original intention for this code was to have long blocks not chain like the others (i.e. the latter), reasoning that outside of the occasional special case (like yours) chainable long blocks would pretty much never occur anyway.
That being said, you could totally add an extra divider character and make long blocks chainable, I would just prefer that it not be an underscore.
LifeWiki: Like Wikipedia but with more spaceships. [citation needed]

Posts: 1950
Joined: November 8th, 2014, 8:48 pm
Location: Getting a snacker from R-Bee's

### Re: Golly scripts

Sorry in advance for the double post, but my previous was only mildly related and long enough already.
So I'm writing a nuSOF (I'll call it this for the time being)-to-RLE converter script and everything seems pretty close to OK but there's an error somewhere in the script that causes Golly to attempt to compare a number with a nil value at line 33 (EDIT: Updated but not fixed):
EDIT 2: Everything works!

Code: Select all

-- Convert a block-encoded clipboard pattern into an RLE clipboard pattern

local g = golly()
local code = g.getclipstr()
local codex = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

local xend = code:find("_")
local yend = code:find("_", xend + 1)
local x = tonumber(code:sub(2, xend - 1)) --x dimension
local y = tonumber(code:sub(xend + 2, yend - 1)) --y dimension
local out = "x = "..x..", y = "..y.."\n"
local pen = tonumber(code:sub(yend + 1, yend + 1)) --state of block being written
local index = yend + 2 --character of code being read
local space = x --unwritten cells in current row
local blocklen = 1 --length of blockcount's string
local templng = 1 --storage value for row wrap handling
local blockct = 1 --blockcount
local row = 1

return codex:find(code:sub(i,i)) end

while (index <= code:len()) do
blocklen = 0
while tonumber(code:sub(index + 1, index + blocklen + 1)) ~= nil do
blocklen = blocklen + 1
end
if code:sub(index,index) ~= "Z" then
if blocklen > 0 then blockct = tonumber(code:sub(index + 1, index + blocklen))
else blockct = 1 end
for i = 1, blockct do
while (templng >= space) do
if pen == 1 then out = out..space.."o" end
out = out.."$" templng = templng - space space = x row = row + 1 end if (templng ~= 0) then if pen == 1 then out = out..templng.."o" else out = out..templng.."b" end end space = space - templng pen = 1 - pen end index = index + 1 + blocklen else templng = tonumber(code:sub(index + 1, index + blocklen)) while (templng >= space) do if pen == 1 then out = out..space.."o" end out = out.."$"
templng = templng - space
space = x
row = row + 1
end
if (templng ~= 0 ) then
if pen == 1 then out = out..templng.."o"
else out = out..templng.."b" end
end
space = space - templng
pen = 1 - pen
index = index + 1 + blocklen
end
end
templng = space + x * (y - row)
while (templng >= space) do
if pen == 1 then out = out..space.."o" end
out = out.."$" templng = templng - space space = x row = row + 1 end g.setclipstr(out.."!")  Also, the code-generating script has been updated; this script will not work with older versions. LifeWiki: Like Wikipedia but with more spaceships. [citation needed] shouldsee Posts: 406 Joined: April 8th, 2016, 8:29 am ### Re: Golly scripts Just a quick dirty script to emulate a 1D wolfram CA, or elementary CA (ECA). I wasn't able to find the perl script when I wrote this one. EDIT: Golly does not support perl anymore, so the aforementioned perl script need to be run otherwise. EDIT: The earlier editoin was flawed. The current version is only tested with W110,W161,W54, Please PM me if it's incompatible with ECA's definition. Code: Select all ## This script generate an ECA rule and emulate it on a torus of width 200. ## Written by Feng (shouldsee.gem@gmail.com) Feb 2017. import sys import golly # 193,62,120 head='''@RULE %s @TABLE n_states:3 neighborhood:Moore symmetries:none var m=0 var p=2 var a={m,1} var b={m,1} var c={m,1} var d={m,1} var e={m,1} var f={m,1} var g={m,1} var h={m,1} m,p,p,m,m,m,f,g,p,%s m,p,1,m,m,m,f,g,p,%s m,1,p,m,m,m,f,g,p,%s m,1,1,m,m,m,f,g,p,%s m,p,p,m,m,m,f,g,1,%s m,p,1,m,m,m,f,g,1,%s m,1,p,m,m,m,f,g,1,%s m,1,1,m,m,m,f,g,1,%s 1,a,b,d,e,f,g,h,c,1 p,a,b,d,e,f,g,h,c,p '''; rnum=golly.getstring('ECA number','110'); name='W'+rnum; file=golly.getdir("rules")+name+".rule" r=bin(int(rnum)); r=r[:1:-1]; r+='0'*(8-len(r)); rule=r; # rule=[0, 1, 1, 1, 1, 1, 0, 0]; dct=['p','1']; with open(file,'w') as f: f.write(head%((name,)+tuple([dct[int(x)] for x in rule]))); golly.setalgo("RuleLoader") golly.setrule(name+':T200,0');  Last edited by shouldsee on February 13th, 2017, 7:29 pm, edited 5 times in total. _zM Posts: 173 Joined: June 26th, 2016, 3:07 pm ### Re: Golly scripts Even-numbered ECA are already natively supported by Golly, use Wxxx for them while in the "Set Rule" dialog. They work in QuickLife and HashLife. Creator of multiple rules that may or may not be what you'd expect shouldsee Posts: 406 Joined: April 8th, 2016, 8:29 am ### Re: Golly scripts _zM wrote:Even-numbered ECA are already natively supported by Golly, use Wxxx for them while in the "Set Rule" dialog. They work in QuickLife and HashLife. True, but I am systematicly screening ECA so can't leave the odd ones. BlinkerSpawn Posts: 1950 Joined: November 8th, 2014, 8:48 pm Location: Getting a snacker from R-Bee's ### Re: Golly scripts Made a rough lua script that *should* create a rule emulating any Wolfram rule with flickering, but I don't know whether the output is correct. Requires you to paste the resulting file from the clipboard because setrule() doesn't accept strings. Code: Select all -- Create an odd Wolfram table from W1 to W127 local g = golly() local n = tonumber(g.getstring("W", "1")) local rule = "@RULE W"..n.."\n@TABLE\nn_States:3\nneighborhood:Moore\nsymmetries:none\n" for i = 7, 0, -1 do local temp = i local s1 = "" local s2 = "" for j = 2, 0, -1 do --Generate the appropriate neighbor set if temp >= 2^j then temp = temp - 2^j s1 = "1"..s1 --Even to odd: 1,a',b',c',d',e',f',0 s2 = "0"..s2 --Odd to even: 1,f,e,d,c,b,a,0 else s1 = "0"..s1 s2 = "2"..s2 end end if n >= 2^i then rule = rule.."0"..s2:sub(2,3).."00000"..s2:sub(1,1).."1\n" n = n - 2^i else rule = rule.."0"..s1:sub(2,3).."00000"..s1:sub(1,1).."2\n" end end g.setclipstr(rule)  Gives different results than shouldsee's script but I manually checked an output file and it looked okay so I'm not sure where the difference lies. LifeWiki: Like Wikipedia but with more spaceships. [citation needed] shouldsee Posts: 406 Joined: April 8th, 2016, 8:29 am ### Re: Golly scripts Take a non-totalistic rule and return its on/off complement. NTCA_invert.py Code: Select all ## This script takes a non-totalistic rule and return its on/off complement. e.g: B2ce3ai/S23 ->B0123478/S012345-ai6-ce78 ## Written by Feng (shouldsee.gem@gmail.com) Feb 2017. import golly import copy alias=golly.getstring('NTCA alias',golly.getrule().split(':')[0]); try: post=golly.getrule().split(':')[1]; except: post=''; ali=alias; henseldict=['b0_','b1c','b1e','b2a','b2c','b3i','b2e','b3a','b2k','b3n','b3j','b4a','s0_','s1c','s1e','s2a','s2c','s3i','s2e','s3a','s2k','s3n','s3j','s4a','b2i','b3r','b3e','b4r','b4i','b5i','s2i','s3r','s3e','s4r','s4i','s5i','b2n','b3c','b3q','b4n','b4w','b5a','s2n','s3c','s3q','s4n','s4w','s5a','b3y','b3k','b4k','b4y','b4q','b5j','b4t','b4j','b5n','b4z','b5r','b5q','b6a','s3y','s3k','s4k','s4y','s4q','s5j','s4t','s4j','s5n','s4z','s5r','s5q','s6a','b4e','b5c','b5y','b6c','s4e','s5c','s5y','s6c','b5k','b6k','b6n','b7c','s5k','s6k','s6n','s7c','b4c','b5e','b6e','s4c','s5e','s6e','b6i','b7e','s6i','s7e','b8_','s8_',]; invhenseldict=['s8_','s7c','s7e','s6a','s6c','s5i','s6e','s5a','s6k','s5n','s5j','s4a','b8_','b7c','b7e','b6a','b6c','b5i','b6e','b5a','b6k','b5n','b5j','b4a','s6i','s5r','s5e','s4n','s4t', 's3i', 'b6i', 'b5r', 'b5e', 'b4n', 'b4t', 'b3i', 's6n', 's5c', 's5q', 's4r', 's4q', 's3a', 'b6n', 'b5c', 'b5q', 'b4r', 'b4q', 'b3a', 's5y', 's5k', 's4k', 's4j', 's4w', 's3j', 's4i', 's4y', 's3n', 's4z', 's3r', 's3q', 's2a', 'b5y', 'b5k', 'b4k', 'b4j', 'b4w', 'b3j', 'b4i', 'b4y', 'b3n', 'b4z', 'b3r', 'b3q', 'b2a', 's4c', 's3c', 's3y', 's2c', 'b4c', 'b3c', 'b3y', 'b2c', 's3k', 's2k', 's2n', 's1c', 'b3k', 'b2k', 'b2n', 'b1c', 's4e', 's3e', 's2e', 'b4e', 'b3e', 'b2e', 's2i', 's1e', 'b2i', 'b1e', 's0_', 'b0_'] henselproj=[101, 89, 99, 73, 81, 35, 95, 47, 87, 69, 66, 23, 100, 85, 97, 60, 77, 29, 92, 41, 83, 56, 53, 11, 98, 71, 94, 45, 67, 17, 96, 58, 91, 39, 54, 5, 88, 79, 72, 33, 65, 19, 84, 75, 59, 27, 52, 7, 80, 86, 63, 68, 46, 22, 34, 64, 21, 70, 31, 44, 15, 76, 82, 50, 55, 40, 10, 28, 51, 9, 57, 25, 38, 3, 93, 43, 61, 16, 90, 37, 48, 4, 62, 20, 42, 13, 49, 8, 36, 1, 78, 32, 18, 74, 26, 6, 30, 14, 24, 2, 12, 0] # invhenseldict=[]; # inv={'b':'s','s':'b'}; # invsub={'c':'e','e':'c','k':'k','a':'a','i':'t','t':'i','n':'r','r':'n','y':'j','j':'y','q':'w','w':'q','z':'z'}; # for v in henseldict: # if v[1]=='4': # end=invsub[v[2]]; # else: # end=v[2] # pass # k=inv[v[0]]+str(8-int(v[1]))+end; # invhenseldict.append(k); henselidx={k: v for v, k in enumerate(henseldict)}; subconf='_cekainyqjrtwz'; def add_all(s,prime,sold,neg=0): for c in subconf: conf=prime+sold+c; try: s[henselidx[conf]]=str(1-neg); except KeyError: pass class rule(): def __init__(self,dgt): self.s=list('0'*dgt); def add(self,ali): ali=ali.replace('/','').lower(); if len(self.s)==102: while True: prime=ali[0]; ali=ali[1:]; sold=[]; # sold=ali[0]; # nold= neg=0; for i,s in enumerate(ali): if s.isdigit(): neg=0; if sold==[]: pass elif sold.isdigit(): add_all(self.s,prime,sold); # golly.note('added all of '+prime+sold) nold=s; elif s in ['b','s']: ali=ali[i:]; break elif s=='-': neg=1; add_all(self.s,prime,nold); # golly.note('added all of '+prime+sold) else: conf=prime+nold+s; self.s[henselidx[conf]]=str(1-neg); # golly.note('added '+conf) alii=ali[i+1:]; sold=s; # golly.note(alii) if sold.isdigit(): add_all(self.s,prime,sold); # golly.note('added all of '+prime+s) if i+1==len(ali): break self.rstr=''.join(self.s[::-1]); self.rnum=hex(int(self.rstr,2)).lstrip('0x').rstrip('L').zfill(26); self.alias=rule2alias(self.s); def inverse(self): self.s=list(str(1-int(self.s[henselproj[i]])) for i,k in enumerate(self.s)); self.rstr=''.join(self.s[::-1]); self.rnum=hex(int(self.rstr,2)).lstrip('0x').rstrip('L').zfill(26); self.alias=rule2alias(self.s); def rule2alias(rlst): alias=''; rlst=[i for i,x in enumerate(rlst) if x=='1']; others=[]; primed=0; for i in rlst: s=henseldict[i]; alias=alias.rstrip('_'); if primed: if s[0]==sold[0]: if s[1]==sold[1]: alias+=s[2] else: alias+=s[1:]; primed=1; else: others.append(s); # pass # break continue else: alias+=s; primed=1; sold=s; alias=alias.rstrip('_'); # golly.note(str(alias)) primed=0; for s in others: alias=alias.rstrip('_'); if primed: if s[0]==sold[0]: if s[1]==sold[1]: alias+=s[2] else: alias+=s[1:]; primed=1; else: others.append(s); # pass # break continue else: alias+=s; primed=1; sold=s; alias=alias.rstrip('_'); return alias r1=rule(102); r1.add(alias); r1.inverse(); rstr=r1.alias+':'+post; golly.setrule(rstr);  Naszvadi Posts: 508 Joined: May 7th, 2016, 8:53 am Contact: ### Re: Golly scripts Here you are, two scripts I made for inspecting this rule: B3i5678/S2i ../forums/viewtopic.php?f=11&t=2840 Must select a rectangular area in order to let them work! Squeezer (may destroy guns, shuttles, glider loops etc) - shrinks spaces between pattern components: Code: Select all # Squeeze # Author: NASZVADI, Peter; 2017 # Some rights reserved, do not violate laws of the author's country! import golly as g TOLGAP = 4 MINGAP = 4 IS_CHANGED = False # ignore empty if g.empty() or (len(g.getselrect()) == 0): g.exit('Senseless!') R = g.getselrect() CELL_LIST = g.getcells( R ) CELL_TUPLES = zip(*[iter(CELL_LIST)]*2) for z in [0, 1]: CELL_TUPLES = [[x[1], x[0]] for x in CELL_TUPLES] CELL_TUPLES.sort() for i in range(len(CELL_TUPLES) - 1): deltas = CELL_TUPLES[i + 1][0] - CELL_TUPLES[i][0] if TOLGAP < deltas: IS_CHANGED = True for j in range(i + 1, len(CELL_TUPLES)): CELL_TUPLES[j][0] += MINGAP - deltas if IS_CHANGED: CELL_LIST = [x for y in CELL_TUPLES for x in y] g.clear(0) g.putcells(CELL_LIST, 0, 0, 1, 0, 0, 1, 'copy') Blinker remover (also removes L-TRIOMINOES, but it is satisfactory for inspecting the rule mentioned in the referred link) Code: Select all # blinkiller # Author: NASZVADI, Peter; 2017 # Some rights reserved, do not violate laws of the author's country! import golly as g # ignore empty if g.empty() or (len(g.getselrect()) == 0): g.exit('Senseless!') R = g.getselrect() CELL_LIST = g.getcells( R ) CELL_TUPLES = zip(*[iter(CELL_LIST)]*2) CELL_TUPLES = [[x[0], x[1]] for x in CELL_TUPLES] CELL_TUPLES.sort() XOR_THIS = [] for i in range(1,len(CELL_TUPLES) - 1): FILTERED = filter(lambda x: abs(x[0]-CELL_TUPLES[i][0])<3 and abs(x[1]-CELL_TUPLES[i][1])<3, CELL_TUPLES) if len(FILTERED) == 3: FILTERED = filter(lambda x: abs(x[0]-CELL_TUPLES[i][0])+abs(x[1]-CELL_TUPLES[i][1])<2, FILTERED) if len(FILTERED) == 3: XOR_THIS += FILTERED if len(XOR_THIS): CELL_LIST = [x for y in XOR_THIS for x in y] g.putcells(CELL_LIST, 0, 0, 1, 0, 0, 1, 'xor')  [EDITED] Naszvadi Posts: 508 Joined: May 7th, 2016, 8:53 am Contact: ### Re: Golly scripts Nathaniel wrote:This script tells you all rules that the current pattern (assumed to be a still life, oscillator, or spaceship) works in. It asks you for its period and then finds all rules under which all of its phases match the phases that are produced by Golly's current rule. Thus, for the script to work correctly, you must have Golly set to a rule that the pattern works under (so if you want to know what rules a glider works in, before running this script set Golly to Life, HighLife or another rule that the glider works in, but not a rule like Seeds). Also, the code is pretty slow and a bit of a mess, but it works for small patterns, which is all I really need it for. getallrules.py Code: Select all # Rule computation script for use with Golly. # Author: Nathaniel Johnston (nathaniel@nathanieljohnston.com), June 2009. # Gives the maximal family of rules that a still life, oscillator, or spaceship # works under. Must be called while the rule is set of one such family # For example, to find out what rules a glider works in, first set the rule # to Life or HighLife, not Seeds. from glife import getstring, validint import golly as g # -------------------------------------------------------------------- def chunks(l, n): for i in range(0, len(l), n): yield l[i:i+n] # -------------------------------------------------------------------- def giveRLE(rl_list): rle_res = "" rle_len = 1 rl_list.sort(cmp = lambda x,y: (x[0]-y[0])+500*(x[1]-y[1])) rl_y = rl_list[0][1] - 1 rl_x = 0 for rl_i in rl_list: if rl_i[1] == rl_y: if rl_i[0] == rl_x + 1: rle_len += 1 else: if rle_len == 1: rle_strA = "" else: rle_strA = str (rle_len) if rl_i[0] - rl_x - 1 == 1: rle_strB = "" else: rle_strB = str (rl_i[0] - rl_x - 1) rle_res = rle_res + rle_strA + "o" + rle_strB + "b" rle_len = 1 else: if rle_len == 1: rle_strA = "" else: rle_strA = str (rle_len) if rl_i[1] - rl_y == 1: rle_strB = "" else: rle_strB = str (rl_i[1] - rl_y) if rl_i[0] == 1: rle_strC = "b" elif rl_i[0] == 0: rle_strC = "" else: rle_strC = str (rl_i[0]) + "b" rle_res = rle_res + rle_strA + "o" + rle_strB + "$" + rle_strC
rle_len = 1

rl_x = rl_i[0]
rl_y = rl_i[1]

if rle_len == 1: rle_strA = ""
else: rle_strA = str (rle_len)
rle_res = rle_res[2:] + rle_strA + "o"

return rle_res

# --------------------------------------------------------------------

rule = g.getrule().upper()

if not rule[0]=="B" or not "/S" in rule:
g.exit("Please set Golly to a Life-like rule.")

if g.empty(): g.exit("The pattern is empty.")
s = g.getstring("Enter the period:","", "Rules calculator")

if not validint(s):
numsteps = int(s)
if numsteps < 1:
g.exit('Period must be at least 1.')

g.select(g.getrect())
g.copy()
s = int(s)

for i in range(0,s):
g.run(1)
clist[i] = list (chunks (g.getcells(g.getrect()), 2))
mcc = min(clist[i])
clist[i] = [[x[0]-mcc[0],x[1]-mcc[1]] for x in clist[i]]

g.show('Processing...')

ruleArr = rule.split("/")
ruleArr[0] = ruleArr[0][1:]
ruleArr[1] = ruleArr[1][1:]

b_need = []
b_OK = []
s_need = []
s_OK = []

for i in ruleArr[0]:
b_need.append(i)
b_OK.append(i)
for i in ruleArr[1]:
s_need.append(i)
s_OK.append(i)

for i in range(0,9):
if not str(i) in b_OK:
b_OK.append(str(i))
g.setrule("B" + "".join(b_OK) + "/S" + ruleArr[1])
for j in range(0,s):
g.run(1)
try:
dlist = list (chunks (g.getcells(g.getrect()), 2))
mcc = min(dlist)
dlist = [[x[0]-mcc[0],x[1]-mcc[1]] for x in dlist]
if not(clist[j] == dlist):
b_OK.remove(str(i))
break
except:
b_OK.remove(str(i))
break
g.new("")
g.paste(0,0,"or")
g.select(g.getrect())

if not str(i) in s_OK:
s_OK.append(str(i))
g.setrule("B" + ruleArr[0] + "/S" + "".join(s_OK))
for j in range(0,s):
g.run(1)
try:
dlist = list (chunks (g.getcells(g.getrect()), 2))
mcc = min(dlist)
dlist = [[x[0]-mcc[0],x[1]-mcc[1]] for x in dlist]
if not(clist[j] == dlist):
s_OK.remove(str(i))
break
except:
s_OK.remove(str(i))
break
g.new("")
g.paste(0,0,"or")
g.select(g.getrect())

if str(i) in b_need:
b_need.remove(str(i))
g.setrule("B" + "".join(b_need) + "/S" + ruleArr[1])
for j in range(0,s):
g.run(1)
try:
dlist = list (chunks (g.getcells(g.getrect()), 2))
mcc = min(dlist)
dlist = [[x[0]-mcc[0],x[1]-mcc[1]] for x in dlist]
if not(clist[j] == dlist):
b_need.append(str(i))
break
except:
b_need.append(str(i))
break
g.new("")
g.paste(0,0,"or")
g.select(g.getrect())

if str(i) in s_need:
s_need.remove(str(i))
g.setrule("B" + ruleArr[0] + "/S" + "".join(s_need))
for j in range(0,s):
g.run(1)
try:
dlist = list (chunks (g.getcells(g.getrect()), 2))
mcc = min(dlist)
dlist = [[x[0]-mcc[0],x[1]-mcc[1]] for x in dlist]
if not(clist[j] == dlist):
s_need.append(str(i))
break
except:
s_need.append(str(i))
break
g.new("")
g.paste(0,0,"or")
g.select(g.getrect())

g.setrule(rule)
ruleres = "B" + "".join(sorted(b_need)) + "/S" + "".join(sorted(s_need)) + " - B" + "".join(sorted(b_OK)) + "/S" + "".join(sorted(s_OK))
g.show(ruleres)
Now my 2cents - needs golly 2.8 or later, handles nontotalistic rules as well. This is a beta version, if anyone is interested, please test it

Code: Select all

# Rule computation script for use with Golly.
# Author: Nathaniel Johnston (nathaniel@nathanieljohnston.com), June 2009.
# Updated by: Peter, NASZVADI (), June 2017.

# Gives the maximal family of rules that a still life, oscillator, or spaceship
# works under. Must be called while the rule is set of one such family
# For example, to find out what rules a glider works in, first set the rule
# to Life or HighLife, not Seeds.
# Handles nontotalistic rules, too, so it needs Golly 2.8 or newer.

import golly as g
from glife import validint
from string import replace

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']
]

# Python versions < 2.4 don't have "sorted" built-in
try:
sorted
except NameError:
def sorted(inlist):
outlist = list(inlist)
outlist.sort()
return outlist

# --------------------------------------------------------------------

def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i+n]

# --------------------------------------------------------------------

def rulestringopt(a):
result = ''
context = ''
lastnum = ''
lastcontext = ''
for i in a:
if i in 'BS':
context = i
result += i
elif i in '012345678':
if (i == lastnum) and (lastcontext == context):
pass
else:
lastcontext = context
lastnum = i
result += i
else:
result += i
result = replace(result, '4aceijknqrtwyz', '4')
result = replace(result, '3aceijknqry', '3')
result = replace(result, '5aceijknqry', '5')
result = replace(result, '2aceikn', '2')
result = replace(result, '6aceikn', '6')
result = replace(result, '1ce', '1')
result = replace(result, '7ce', '7')
return result

clist = []
rule = g.getrule().split(':')[0]

fuzzer = rule + '9'
oldrule = rule
rule = ''
context = ''
deletefrom = []
for i in fuzzer:
if i == '-':
deletefrom = [x[1] for x in Hensel[int(context)]]
elif i in '0123456789/S':
if deletefrom:
rule += ''.join(deletefrom)
deletefrom = []
context = i
if len(deletefrom) == 0:
rule += i
elif i in deletefrom:
deletefrom.remove(i)
rule = rule.strip('9')

if not (rule[0] == 'B' and '/S' in rule):
g.exit('Please set Golly to a Life-like rule.')

if g.empty():
g.exit('The pattern is empty.')

s = g.getstring('Enter the period:', '', 'Rules calculator')
if not validint(s):

numsteps = int(s)
if numsteps < 1:
g.exit('Period must be at least 1.')

g.select(g.getrect())
g.copy()
s = int(s)

for i in range(0,s):
g.run(1)
clist.append(list(chunks(g.getcells(g.getrect()), 2)))
mcc = min(clist[i])
clist[i] = [[x[0] - mcc[0], x[1] - mcc[1]] for x in clist[i]]

g.show('Processing...')

ruleArr = rule.split('/')
ruleArr[0] = ruleArr[0].lstrip('B')
ruleArr[1] = ruleArr[1].lstrip('S')

b_need = []
b_OK = []
s_need = []
s_OK = []

context = ''
fuzzed = ruleArr[0] + '9'
for i in fuzzed:
if i in '0123456789':
if len(context) == 1:
b_need += Hensel[int(context)]
b_OK += Hensel[int(context)]
context = i
elif context != '':
b_need.append(context[0] + i)
b_OK.append(context[0] + i)
context += context[0]
context = ''
fuzzed = ruleArr[1] + '9'
for i in fuzzed:
if i in '0123456789':
if len(context) == 1:
s_need += Hensel[int(context)]
s_OK += Hensel[int(context)]
context = i
elif context != '':
s_need.append(context[0] + i)
s_OK.append(context[0] + i)
context += context[0]

for i in [iter2 for iter1 in Hensel for iter2 in iter1]:
if not i in b_OK:
b_OK.append(i)
execfor = 1
# B0 and nontotalistic rulestrings are mutually exclusive
try:
g.setrule(rulestringopt('B' + ''.join(b_OK) + '/S' + ruleArr[1]))
except:
b_OK.remove(i)
execfor = 0
for j in range(0, s * execfor):
g.run(1)
try:
dlist = list(chunks(g.getcells(g.getrect()), 2))
mcc = min(dlist)
dlist = [[x[0] - mcc[0], x[1] - mcc[1]] for x in dlist]
if not(clist[j] == dlist):
b_OK.remove(i)
break
except:
b_OK.remove(i)
break
g.new('')
g.paste(0, 0, 'or')
g.select(g.getrect())
b_OK.sort()

if not i in s_OK:
s_OK.append(i)
execfor = 1
# B0 and nontotalistic rulestrings are mutually exclusive
try:
g.setrule(rulestringopt('B' + ruleArr[0] + '/S' + ''.join(s_OK)))
except:
s_OK.remove(i)
execfor = 0
for j in range(0, s * execfor):
g.run(1)
try:
dlist = list(chunks(g.getcells(g.getrect()), 2))
mcc = min(dlist)
dlist = [[x[0] - mcc[0], x[1] - mcc[1]] for x in dlist]
if not(clist[j] == dlist):
s_OK.remove(i)
break
except:
s_OK.remove(i)
break
g.new('')
g.paste(0, 0, 'or')
g.select(g.getrect())
s_OK.sort()

if i in b_need:
b_need.remove(i)
g.setrule(rulestringopt('B' + ''.join(b_need) + '/S' + ruleArr[1]))
for j in range(0, s):
g.run(1)
try:
dlist = list(chunks(g.getcells(g.getrect()), 2))
mcc = min(dlist)
dlist = [[x[0] - mcc[0], x[1] - mcc[1]] for x in dlist]
if not(clist[j] == dlist):
b_need.append(i)
break
except:
b_need.append(i)
break
g.new('')
g.paste(0, 0, 'or')
g.select(g.getrect())
b_need.sort()

if i in s_need:
s_need.remove(i)
g.setrule(rulestringopt('B' + ruleArr[0] + '/S' + ''.join(s_need)))
for j in range(0, s):
g.run(1)
try:
dlist = list(chunks(g.getcells(g.getrect()), 2))
mcc = min(dlist)
dlist = [[x[0] - mcc[0], x[1] - mcc[1]] for x in dlist]
if not(clist[j] == dlist):
s_need.append(i)
break
except:
s_need.append(i)
break
g.new('')
g.paste(0, 0, 'or')
g.select(g.getrect())
s_need.sort()

g.setrule(oldrule)
ruleres = 'B' + ''.join(sorted(b_need)) + '/S' + ''.join(sorted(s_need)) + \
' - B' + ''.join(sorted(b_OK)) + '/S' + ''.join(sorted(s_OK))
ruleres = rulestringopt(ruleres)
g.show(ruleres)

[Updated] fixed one error - unhandled rulestrings containing minus.
Last edited by Naszvadi on June 30th, 2017, 7:09 am, edited 1 time in total.

Posts: 508
Joined: May 7th, 2016, 8:53 am
Contact:

### Re: Golly scripts

For those who want to investigate Neumann rules:

getallneumannrules.py:

Code: Select all

# Neumann rule computation script for use with Golly.
# Original script's author: Nathaniel Johnston (nathaniel@nathanieljohnston.com), June 2009.
# Altered by: Peter, NASZVADI (), June 2017.

# Gives the maximal family of rules that a still life, oscillator, or spaceship
# works under. Must be called while the rule is set of one such family
# For example, to find out what rules a glider works in, first set the rule
# to one that really supports it

import golly as g
from glife import validint

# Python versions < 2.4 don't have "sorted" built-in
try:
sorted
except NameError:
def sorted(inlist):
outlist = list(inlist)
outlist.sort()
return outlist

# --------------------------------------------------------------------

def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i+n]

# --------------------------------------------------------------------

clist = []
rule = g.getrule().split(':')[0]

if not (rule[0] == 'B' and '/S' in rule and rule[-1] == "V"):
g.exit('Please set Golly to a Neumann totalistic rule.')

if g.empty():
g.exit('The pattern is empty.')

s = g.getstring('Enter the period:', '', 'Rules calculator')
if not validint(s):

numsteps = int(s)
if numsteps < 1:
g.exit('Period must be at least 1.')

g.select(g.getrect())
g.copy()
s = int(s)

for i in range(0,s):
g.run(1)
clist.append(list(chunks(g.getcells(g.getrect()), 2)))
mcc = min(clist[i])
clist[i] = [[x[0] - mcc[0], x[1] - mcc[1]] for x in clist[i]]

g.show('Processing...')

ruleArr = rule.split('/')
ruleArr[0] = ruleArr[0].lstrip('B')
ruleArr[1] = ruleArr[1].lstrip('S').rstrip('V')

b_need = []
b_OK = []
s_need = []
s_OK = []

for i in '01234':
if not i in b_OK:
b_OK.append(i)
g.setrule('B' + ''.join(sorted(b_OK)) + '/S' + ruleArr[1] + 'V')
for j in range(0, s):
g.run(1)
try:
dlist = list(chunks(g.getcells(g.getrect()), 2))
mcc = min(dlist)
dlist = [[x[0] - mcc[0], x[1] - mcc[1]] for x in dlist]
if not(clist[j] == dlist):
b_OK.remove(i)
break
except:
b_OK.remove(i)
break
g.new('')
g.paste(0, 0, 'or')
g.select(g.getrect())

if not i in s_OK:
s_OK.append(i)
g.setrule('B' + ruleArr[0] + '/S' + ''.join(sorted(s_OK)) + 'V')
for j in range(0, s):
g.run(1)
try:
dlist = list(chunks(g.getcells(g.getrect()), 2))
mcc = min(dlist)
dlist = [[x[0] - mcc[0], x[1] - mcc[1]] for x in dlist]
if not(clist[j] == dlist):
s_OK.remove(i)
break
except:
s_OK.remove(i)
break
g.new('')
g.paste(0, 0, 'or')
g.select(g.getrect())

if i in b_need:
b_need.remove(i)
g.setrule('B' + ''.join(sorted(b_need)) + '/S' + ruleArr[1] + 'V')
for j in range(0, s):
g.run(1)
try:
dlist = list(chunks(g.getcells(g.getrect()), 2))
mcc = min(dlist)
dlist = [[x[0] - mcc[0], x[1] - mcc[1]] for x in dlist]
if not(clist[j] == dlist):
b_need.append(i)
break
except:
b_need.append(i)
break
g.new('')
g.paste(0, 0, 'or')
g.select(g.getrect())

if i in s_need:
s_need.remove(i)
g.setrule('B' + ruleArr[0] + '/S' + ''.join(sorted(s_need)) + 'V')
for j in range(0, s):
g.run(1)
try:
dlist = list(chunks(g.getcells(g.getrect()), 2))
mcc = min(dlist)
dlist = [[x[0] - mcc[0], x[1] - mcc[1]] for x in dlist]
if not(clist[j] == dlist):
s_need.append(i)
break
except:
s_need.append(i)
break
g.new('')
g.paste(0, 0, 'or')
g.select(g.getrect())

g.setrule(rule)
ruleres = 'B' + ''.join(sorted(b_need)) + '/S' + ''.join(sorted(s_need)) + 'V' \
+ ' - B' + ''.join(sorted(b_OK)) + '/S' + ''.join(sorted(s_OK)) + 'V'
g.show(ruleres)

[EDITED]

It is buggy at the moment.

wildmyron
Posts: 1367
Joined: August 9th, 2013, 12:45 am

### Re: Golly scripts

Nathaniel wrote:<snip> getallrules.py
Now my 2cents - needs golly 2.8 or later, handles nontotalistic rules as well. This is a beta version, if anyone is interested, please test it

Code: Select all

<snip> isotropic version of getallrules.py

Thank you for posting this. It's been requested several times on the forum so I'm surprised there was no comment up until now. It seems to work as expected after some limited testing.

I use a trick posted elsewhere which uses g.getstring() to display the result in a way which makes it easy to copy (without the script clobbering the clipboard):

Code: Select all

...
g.show(ruleres)
g.getstring('Pattern works in rules:', ruleres, 'Rules calculator')

I debated whether it is better to have the result in Golly's canonical rule format or not. I think on balance it is easier to interpret the way you have it (with no '-' symbols) when comparing the minimal and maximal rule.
The latest version of the 5S Project contains over 226,000 spaceships. There is also a GitHub mirror of the collection. Tabulated pages up to period 160 (out of date) are available on the LifeWiki.

Posts: 508
Joined: May 7th, 2016, 8:53 am
Contact:

### Re: Golly scripts

wildmyron wrote: ...

Code: Select all

...
g.show(ruleres)
g.getstring('Pattern works in rules:', ruleres, 'Rules calculator')

...
Thanks, your modification is an excellent idea! The short lifespan of status line caused headaches, until now. This getstring method invocation should be appended to the original as well, IMHO. Hope Nathaniel (as an author of the base script) will read this post and includes these in future versions of Golly. Both outer-totalistic and hensel-scripts are needed, none of them are obsolete. I am going to make an update for the latter one, which calculates the containing neumann and moore totalistic rule intervals where the input pattern works. Who will be faster, any volunteers?

Rhombic
Posts: 1064
Joined: June 1st, 2013, 5:41 pm

### Re: Golly scripts

I cannot find the bug in this script, but it should otherwise be pretty much finished.
MAP_rotate.py is meant to rotate a given MAP rule by 90º, clockwise. If someone can help me find the bug, I'll change this post with the working version.

Code: Select all

wrong
EDIT: script:

Code: Select all

# MAP_rotate.py
# Rotates a given MAP rule 90 degrees clockwise.
# Author: Rhombic

import golly as g

if g.getrule()[:3] == "MAP":
rule = g.getrule()[3:]
MAPinit = 1
else:
rule = g.getstring("MAP rule to rotate clockwise (default is CGoL) with the MAP prefix.","MAPARYXfhZofugWaH7oaIDogBZofuhogOiAaIDogIAAgAAWaH7oaIDogGiA6ICAAIAAaIDogIAAgACAAIAAAAAAAA")[3:]
MAPinit = 0
base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
brule = ""
bnewrule = ""
newrule = "MAP"
changelist = []
rotatelookup=[64,8,1,128,16,2,256,32,4]
for k in xrange(86):
brulepos = "{0:06b}".format(int(base64.index(rule[k])))
brule = brule + brulepos
for i in xrange(512):
if brule[i] == "1":
b10n4conv2b = 0
n = "{0:09b}".format(i)
for j in range(9):
if n[j] == "1":
b10n4conv2b += rotatelookup[j]
changelist.append(b10n4conv2b)
b10n4conv2b = 0

for tt in xrange(512):
bnewrule+="0" if tt not in changelist else "1"
bnewrule = bnewrule + "0000"
for ttt in xrange(86):
newrule = newrule + base64[int(str(bnewrule[6*ttt:6*ttt+6]), 2)]
if MAPinit == 1:
g.show("In case you needed the previous rule, it has been copied to your clipboard.")
g.setclipstr("MAP"+rule)
g.setrule(newrule)
else:
g.setclipstr(newrule)
g.show("The new rule has been copied to your clipboard.")

Last edited by Rhombic on August 8th, 2017, 3:46 pm, edited 6 times in total.
SoL : FreeElectronics : DeadlyEnemies : 6a-ite : Rule X3VI
what is “sesame oil”?

dvgrn
Moderator
Posts: 6454
Joined: May 17th, 2009, 11:00 pm
Contact:

### Re: Golly scripts

Rhombic wrote:I cannot find the bug in this script, but it should otherwise be pretty much finished.
Yup, it looks good! It turns out there are three bugs, all very sneaky and small. You had

Code: Select all

n = "{0:09b}".format(int(bin(i)[2:]))
when you probably meant either

Code: Select all

n = "{0:09d}".format(int(bin(i)[2:]))
{or}
n = "{0:09b}".format(i)
And then at the bottom

Code: Select all

for ttt in xrange(85):
newrule = newrule + base64[int(str(bnewrule[6*ttt:6*ttt+5]), 2)]
should really be

Code: Select all

for ttt in xrange(86):
newrule = newrule + base64[int(str(bnewrule[6*ttt:6*ttt+6]), 2)]
Two fencepost errors in quick succession -- but everything else looks perfect. I haven't actually tested the patched version, except to make sure that rotated B3/S23 Life is still the same MAP string. But the bits you're choosing to add for each n[j] == "1" are definitely the same ones I would choose, so I think it should all work fine.

There are shorter forms that you can play with if you want -- e.g.,

Code: Select all

bnewrule = ""
for tt in xrange(512):
if tt not in changelist:
bnewrule = bnewrule + "0"
if tt in changelist:
bnewrule = bnewrule + "1"
could turn into

Code: Select all

bnewrule = ""
for tt in xrange(512):
bnewrule+="0" if tt not in changelist else "1"
or even

Code: Select all

bnewrule = "".join(["0" if tt not in changelist else "1" for tt in xrange(512)])
but your version is arguably more readable for everyone except Python nerds, so maybe you should just replace the second "if" clause with an "else:". Could also reduce a lot of clutter by using the same lookup trick that you're using in the base64 string, to add the correct bit to b10n4conv2b:

Code: Select all

rotatelookup=[4,32,256,2,16,128,1,8,64]
...
b10n4conv2b += rotatelookup[j]

Rhombic
Posts: 1064
Joined: June 1st, 2013, 5:41 pm

### Re: Golly scripts

I have modified the script and now it works -at least, in principle, but the behaviour is somewhat unexpected.

I'm fairly sure the code was meant for a 90º clockwise rotation, yet B37e(S)/S23 (the hole pointing down) becomes B37e(E)/S23 (the hole pointing to the right)... how did this happen?
SoL : FreeElectronics : DeadlyEnemies : 6a-ite : Rule X3VI
what is “sesame oil”?

dvgrn
Moderator
Posts: 6454
Joined: May 17th, 2009, 11:00 pm
Contact:

### Re: Golly scripts

I have modified the script and now it works -at least, in principle, but the behaviour is somewhat unexpected.

I'm fairly sure the code was meant for a 90º clockwise rotation, yet B37e(S)/S23 (the hole pointing down) becomes B37e(E)/S23 (the hole pointing to the right)... how did this happen?
Yeah, it does counterclockwise rotation -- I just tried MAPQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, which moves single dots NW. It's rotating the wrong way because you believed me when I suggested a re-ordering of the bits, but I had it backward. (The odds were about 50% of that happening unless I actually wrote the code and tested it.)

Really if you take the the bit in the 0 position -- which is the highest bit, worth 256 -- and you move it to the 6 position, the third-to-lowest bit, worth 4 ... then you're moving a NW bit to the SW corner, which is a counter-clockwise rotation.

Makes perfect sense now that I know what it actually does...! You probably don't need me to suggest reversing the lookup list:

Code: Select all

rotatelookup=[64,8,1,128,16,2,256,32,4]
A nice variant of this might be to use g.getrule() to retrieve Golly's current MAP rule at the beginning, make sure it's 89 characters, take off the MAP at the beginning, and then change the rule directly with g.setrule() instead of copying the text to the clipboard. Maybe call g.getstring() and output to the clipboard only if the current rule isn't a MAP rule. (?)

Rhombic
Posts: 1064
Joined: June 1st, 2013, 5:41 pm

### Re: Golly scripts

dvgrn wrote: A nice variant of this might be to use g.getrule() to retrieve Golly's current MAP rule at the beginning, make sure it's 89 characters, take off the MAP at the beginning, and then change the rule directly with g.setrule() instead of copying the text to the clipboard. Maybe call g.getstring() and output to the clipboard only if the current rule isn't a MAP rule. (?)
Done!

Code: Select all

# MAP_rotate.py
# Rotates a given MAP rule 90 degrees clockwise.
# Author: Rhombic

import golly as g

if g.getrule()[:3] == "MAP":
rule = g.getrule()[3:]
MAPinit = 1
else:
rule = g.getstring("MAP rule to rotate clockwise (default is CGoL) with the MAP prefix.","MAPARYXfhZofugWaH7oaIDogBZofuhogOiAaIDogIAAgAAWaH7oaIDogGiA6ICAAIAAaIDogIAAgACAAIAAAAAAAA")[3:]
MAPinit = 0
base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
brule = ""
bnewrule = ""
newrule = "MAP"
changelist = []
rotatelookup=[64,8,1,128,16,2,256,32,4]
for k in xrange(86):
brulepos = "{0:06b}".format(int(base64.index(rule[k])))
brule = brule + brulepos
for i in xrange(512):
if brule[i] == "1":
b10n4conv2b = 0
n = "{0:09b}".format(i)
for j in range(9):
if n[j] == "1":
b10n4conv2b += rotatelookup[j]
changelist.append(b10n4conv2b)
b10n4conv2b = 0

for tt in xrange(512):
bnewrule+="0" if tt not in changelist else "1"
bnewrule = bnewrule + "0000"
for ttt in xrange(86):
newrule = newrule + base64[int(str(bnewrule[6*ttt:6*ttt+6]), 2)]
if MAPinit == 1:
g.show("In case you needed the previous rule, it has been copied to your clipboard.")
g.setclipstr("MAP"+rule)
g.setrule(newrule)
else:
g.setclipstr(newrule)
g.show("The new rule has been copied to your clipboard.")

(code updated)
EDIT: There is a bug!! Try rotating a rule 4 times, the rules do not match! (I realised with a rule that only had words in it) MAPODannyBoyThePipesThePipesAreCallingFromGlenToGlenAndDownTheMountainSides+TheSummer///A
MAPODannyBoyThePipesThePipesAreCallingFromGlejToGlenAndDownTheMountainSides+TheSummer//7I
Last edited by Rhombic on July 7th, 2017, 9:54 am, edited 1 time in total.
SoL : FreeElectronics : DeadlyEnemies : 6a-ite : Rule X3VI
what is “sesame oil”?

dvgrn
Moderator
Posts: 6454
Joined: May 17th, 2009, 11:00 pm
Contact:

### Re: Golly scripts

Rhombic wrote:EDIT: There is a bug!! Try rotating a rule 4 times, the rules do not match! (I realised with a rule that only had words in it) MAPODannyBoyThePipesThePipesAreCallingFromGlenToGlenAndDownTheMountainSides+TheSummer///A
MAPODannyBoyThePipesThePipesAreCallingFromGlejToGlenAndDownTheMountainSides+TheSummer//7I
Interesting. The problem is quite subtle -- only hits a few bits out of the 512, and it seems to be consistently losing a couple of bits that should be ON, rather than turning on bits that should be OFF.

Code: Select all

MAPFourscoreAndSevenYearsAgoOurFathersBroughtForthOnThisContinentANewNationConceivedInLib
MAPFourscoreAndSevenYearsAgoOurFathersBroughtBorthOnThisContinentANewNationCojceivedInLiA
*                               * 
You can't count the change in the last character in my sample as a bug, since the last four bits are ignored anyway -- but if the last character is A that shouldn't be a problem.

I don't see any more fencepost problems that seem likely to cause two bits to be lost... and the bug doesn't happen to damage my minimal test or the B3/S23 MAP rule. Maybe the lost bits were OFF bits in those cases. Well --

Code: Select all

MAP//////////////////////////////////////////////////////////////////////////////////////
MAP/////////////////////////////////////////////////////////////////////////////////////Y
MAP////////////////////////////////////////////////////////////////////////////////////7Y
MAP//////////////////////////////////////////7/////////////////////////////////////////7Y
MAP//////////////////////////////////////////7///////////////////////////////7/////////7Y
MAP//////////////////////////////////////////7///////////////////////////////7/////////7I
MAP//////////////////////////////////////////7///////////////////////////////7/////////7A
MAP//////////////////////////////////////////7///////////////////////////////7/////////7A
...
EDIT: Ah, there it is. You had

Code: Select all

bnewrule = bnewrule + "000"
but there are four padding bits needed after 512 characters to reach a multiple of 6 -- so the very last conversion was one significant digit shorter than it needed to be... which was not a problem if it was all zeroes anyway.

bnewrule += "0000" seems to work fine -- it's well behaved even with

Code: Select all

MAP/////////////////////////////////////////////////////////////////////////////////////w

calcyman
Posts: 2141
Joined: June 1st, 2009, 4:32 pm

### Re: Golly scripts

You seem to be appending "000" (and getting a string of 515 bits), when I would have thought appending "0000" (to get a string of 516 bits) would be the logical choice.

I guess this would cause Python to take the last 5 bits instead of 6, and thus the last base64 digit would be exactly half of what it should be...?
What do you do with ill crystallographers? Take them to the mono-clinic!

wwei23
Posts: 949
Joined: May 22nd, 2017, 6:14 pm
Location: The (Life?) Universe

### Re: Golly scripts

gmc_nxtman wrote:Those are really cool scripts, but all I need is a script which takes in a life-like rulestring, and turns it into a table of the exact same rule. Also, is there some script, which upon input of some oscillator and its period, generates how many possible collisions there are with a single glider, and shows them in a table? I would like to find tumbler-glider reactions, to reintroduce the possibility of a true-period 14 gun, and once I find the suitable reactions I might start.
Maybe a true-period 15 gun could be built with results from pd-glider.py. I might do that..Other scripts I would want are a polyomino calculator/displayer, and an inverse-rule generator.

Universal life file converters would also be convenient. These are the ones I would need:

Life 1.06 to RLE
Life 1.05 to RLE
RLE to SoF
SoF to MC
To count all n-ominos, take each n-1-omino, make a list of each n-1-omino with 1 cell in its Von-Neumann neighborhood turned on, combine all the lists, and remove duplicates.
Hexomino+neighborhoods:

Code: Select all

x = 446, y = 5, rule = LifeHistory
3.3B7.5B8.5B10.3B8.4B9.4B9.4B9.4B11.2B23.B13.B13.B9.4B11.2B48.3B10.3B
23.3B10.B13.B11.3B10.3B23.3B23.B13.B11.2B11.B13.B11.2B$6AB5.B5AB6.B5A B7.5AB6.B4AB7.B4AB7.B4AB7.B4AB8.4AB8.A.2B9.BA2B9.2BAB9.3BAB7.B4AB8.4A B9.A2B11.A10.3A2B7.B3AB8.B3AB9.3AB8.B3AB8.BA2B10.BAB9.B3AB8.B3AB9.3AB 8.B3AB9.3A9.BA2B10.BAB9.B2A2B8.BA2B11.AB9.B2AB$13.4BAB7.3BAB10.A2B8.
3B2AB7.3BAB8.2B2AB8.BABAB8.A.BAB8.4AB7.B4AB7.B4AB7.B4AB8.2BAB10.2AB9.
4AB7.B4AB10.3AB7.2B2AB8.2B2AB9.3AB7.BAB2AB7.B3AB8.B3AB9.2BAB9.2BAB10.
2AB9.B2AB9.3AB8.B3AB9.3AB9.B3AB7.B3AB9.3AB9.B2A$17.B11.B11.B13.2B10.B AB10.2B10.B.B12.B11.BAB8.3BAB8.3BAB11.A10.BAB11.B12.AB9.2BAB11.3B10.B AB9.BAB10.3B9.B.2B9.2B2AB8.2B2AB9.B2AB8.B2AB10.BAB9.BAB11.2B10.B2AB 10.2AB9.BA2B8.BABAB9.ABAB11.2A$68.B51.B12.B12.B24.B25.B12.B26.B11.B
38.2B11.2B11.2B10.2B12.B11.B25.2B24.B11.B.B12.B!

Note that time can be saved on symmetry. If you can recover the whole thing by flipping and rotating along symmetries, then you're good to go.

wwei23
Posts: 949
Joined: May 22nd, 2017, 6:14 pm
Location: The (Life?) Universe

### Re: Golly scripts

We get this:

Code: Select all

x = 446, y = 125, rule = LifeHistory
3.3B7.5B8.5B10.3B8.4B9.4B9.4B9.4B11.2B23.B13.B13.B9.4B11.2B48.3B10.3B
23.3B10.B13.B11.3B10.3B23.3B23.B13.B11.2B11.B13.B11.2B$6AB5.B5AB6.B5A B7.5AB6.B4AB7.B4AB7.B4AB7.B4AB8.4AB8.A.2B9.BA2B9.2BAB9.3BAB7.B4AB8.4A B9.A2B11.A10.3A2B7.B3AB8.B3AB9.3AB8.B3AB8.BA2B10.BAB9.B3AB8.B3AB9.3AB 8.B3AB9.3A9.BA2B10.BAB9.B2A2B8.BA2B11.AB9.B2AB$13.4BAB7.3BAB10.A2B8.
3B2AB7.3BAB8.2B2AB8.BABAB8.A.BAB8.4AB7.B4AB7.B4AB7.B4AB8.2BAB10.2AB9.
4AB7.B4AB10.3AB7.2B2AB8.2B2AB9.3AB7.BAB2AB7.B3AB8.B3AB9.2BAB9.2BAB10.
2AB9.B2AB9.3AB8.B3AB9.3AB9.B3AB7.B3AB9.3AB9.B2A$17.B11.B11.B13.2B10.B AB10.2B10.B.B12.B11.BAB8.3BAB8.3BAB11.A10.BAB11.B12.AB9.2BAB11.3B10.B AB9.BAB10.3B9.B.2B9.2B2AB8.2B2AB9.B2AB8.B2AB10.BAB9.BAB11.2B10.B2AB 10.2AB9.BA2B8.BABAB9.ABAB11.2A$68.B51.B12.B12.B24.B25.B12.B26.B11.B
38.2B11.2B11.2B10.2B12.B11.B25.2B24.B11.B.B12.B6$3.3B7.5B8.5B10.3B8. 4B9.4B9.4B9.4B11.2B23.B13.B13.B9.4B11.2B48.3B10.3B23.3B10.B13.B11.3B 10.3B23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BABAB9.ABAB11.2A$68.B51.B12.B12.B24.B25.B12.B26.B11.B 38.2B11.2B11.2B10.2B12.B11.B25.2B24.B11.B.B12.B6$13.5B8.5B10.3B8.4B9.
4B9.4B9.4B11.2B23.B13.B13.B9.4B11.2B48.3B10.3B23.3B10.B13.B11.3B10.3B
23.3B23.B13.B11.2B11.B13.B11.2B$12.B5AB6.B5AB7.5AB6.B4AB7.B4AB7.B4AB 7.B4AB8.4AB8.A.2B9.BA2B9.2BAB9.3BAB7.B4AB8.4AB9.A2B11.A10.3A2B7.B3AB 8.B3AB9.3AB8.B3AB8.BA2B10.BAB9.B3AB8.B3AB9.3AB8.B3AB21.BA2B10.BAB9.B 2A2B8.BA2B11.AB9.B2AB$13.4BAB7.3BAB10.A2B8.3B2AB7.3BAB8.2B2AB8.BABAB
8.A.BAB8.4AB7.B4AB7.B4AB7.B4AB8.2BAB10.2AB9.4AB7.B4AB10.3AB7.2B2AB8.
2B2AB9.3AB7.BAB2AB7.B3AB8.B3AB9.2BAB9.2BAB10.2AB9.B2AB21.B3AB9.3AB9.B
3AB7.B3AB9.3AB9.B2A$17.B11.B11.B13.2B10.BAB10.2B10.B.B12.B11.BAB8.3BA B8.3BAB11.A10.BAB11.B12.AB9.2BAB11.3B10.BAB9.BAB10.3B9.B.2B9.2B2AB8. 2B2AB9.B2AB8.B2AB10.BAB9.BAB23.B2AB10.2AB9.BA2B8.BABAB9.ABAB11.2A$68.
B51.B12.B12.B24.B25.B12.B26.B11.B38.2B11.2B11.2B10.2B12.B11.B25.2B24.
B11.B.B12.B6$13.5B8.5B10.3B8.4B9.4B9.4B9.4B11.2B23.B13.B13.B9.4B61.3B 10.3B23.3B10.B13.B11.3B10.3B23.3B23.B25.2B11.B13.B$12.B5AB6.B5AB7.5AB
6.B4AB7.B4AB7.B4AB7.B4AB8.4AB8.A.2B9.BA2B9.2BAB9.3BAB7.B4AB36.A10.3A
2B7.B3AB8.B3AB21.B3AB8.BA2B10.BAB9.B3AB8.B3AB21.B3AB21.BA2B22.B2A2B8.
BA2B11.AB$13.4BAB7.3BAB10.A2B8.3B2AB7.3BAB8.2B2AB8.BABAB8.A.BAB8.4AB 7.B4AB7.B4AB7.B4AB8.2BAB34.B4AB10.3AB7.2B2AB8.2B2AB20.BAB2AB7.B3AB8.B 3AB9.2BAB9.2BAB22.B2AB21.B3AB22.B3AB7.B3AB9.3AB$17.B11.B11.B13.2B10.B
AB10.2B10.B.B12.B11.BAB8.3BAB8.3BAB11.A10.BAB35.2BAB11.3B10.BAB9.BAB
22.B.2B9.2B2AB8.2B2AB9.B2AB8.B2AB22.BAB23.B2AB22.BA2B8.BABAB9.ABAB$68.B51.B12.B12.B24.B38.B26.B11.B38.2B11.2B11.2B10.2B24.B25.2B24.B11.B .B12.B6$13.5B8.5B10.3B8.4B9.4B9.4B9.4B36.B13.B13.B9.4B61.3B10.3B23.3B
10.B13.B11.3B10.3B23.3B23.B25.2B11.B$12.B5AB6.B5AB7.5AB6.B4AB7.B4AB7. B4AB7.B4AB34.BA2B9.2BAB9.3BAB7.B4AB59.B3AB8.B3AB21.B3AB8.BA2B10.BAB9. B3AB8.B3AB21.B3AB21.BA2B22.B2A2B8.BA2B$13.4BAB7.3BAB10.A2B8.3B2AB7.3B
AB8.2B2AB8.BABAB33.B4AB7.B4AB7.B4AB8.2BAB61.2B2AB8.2B2AB20.BAB2AB7.B
3AB8.B3AB9.2BAB9.2BAB22.B2AB21.B3AB22.B3AB7.B3AB$17.B11.B11.B13.2B10. BAB10.2B10.B.B35.3BAB8.3BAB11.A10.BAB63.BAB9.BAB22.B.2B9.2B2AB8.2B2AB 9.B2AB8.B2AB22.BAB23.B2AB22.BA2B8.BABAB$68.B64.B12.B24.B65.B11.B38.2B
11.2B11.2B10.2B24.B25.2B24.B11.B.B6$13.5B8.5B21.4B9.4B9.4B9.4B36.B13. B23.4B61.3B10.3B23.3B10.B13.B11.3B10.3B23.3B23.B25.2B11.B$12.B5AB6.B
5AB19.B4AB7.B4AB7.B4AB7.B4AB34.BA2B9.2BAB21.B4AB59.B3AB8.B3AB21.B3AB
8.BA2B10.BAB9.B3AB8.B3AB21.B3AB21.BA2B22.B2A2B8.BA2B$13.4BAB7.3BAB21. 3B2AB7.3BAB8.2B2AB8.BABAB33.B4AB7.B4AB21.2BAB61.2B2AB8.2B2AB20.BAB2AB 7.B3AB8.B3AB9.2BAB9.2BAB22.B2AB21.B3AB22.B3AB7.B3AB$17.B11.B25.2B10.B
AB10.2B10.B.B35.3BAB8.3BAB22.BAB63.BAB9.BAB22.B.2B9.2B2AB8.2B2AB9.B2A
B8.B2AB22.BAB23.B2AB22.BA2B8.BABAB$68.B64.B12.B24.B65.B11.B38.2B11.2B 11.2B10.2B24.B25.2B24.B11.B.B6$13.5B8.5B21.4B9.4B9.4B9.4B36.B13.B23.
4B61.3B10.3B23.3B10.B13.B11.3B10.3B23.3B23.B25.2B11.B$12.B5AB6.B5AB 19.B4AB7.B4AB7.B4AB7.B4AB34.BA2B9.2BAB21.B4AB59.B3AB8.B3AB21.B3AB8.BA 2B10.BAB9.B3AB8.B3AB21.B3AB21.BA2B22.B2A2B8.BA2B$13.4BAB7.3BAB21.3B2A
B7.3BAB8.2B2AB8.BABAB33.B4AB7.B4AB21.2BAB61.2B2AB8.2B2AB20.BAB2AB7.B
3AB8.B3AB9.2BAB9.2BAB22.B2AB21.B3AB22.B3AB7.B3AB$17.B11.B25.2B10.BAB 10.2B10.B.B35.3BAB8.3BAB22.BAB63.BAB9.BAB22.B.2B9.2B2AB8.2B2AB9.B2AB 8.B2AB22.BAB23.B2AB22.BA2B8.BABAB$68.B64.B12.B24.B65.B11.B38.2B11.2B
11.2B10.2B24.B25.2B24.B11.B.B6$13.5B8.5B21.4B9.4B9.4B9.4B36.B13.B23. 4B61.3B10.3B23.3B10.B13.B11.3B10.3B23.3B23.B25.2B11.B$12.B5AB6.B5AB
19.B4AB7.B4AB7.B4AB7.B4AB34.BA2B9.2BAB21.B4AB59.B3AB8.B3AB21.B3AB8.BA
2B10.BAB9.B3AB8.B3AB21.B3AB21.BA2B22.B2A2B8.BA2B$13.4BAB7.3BAB21.3B2A B7.3BAB8.2B2AB8.BABAB33.B4AB7.B4AB21.2BAB61.2B2AB8.2B2AB20.BAB2AB7.B 3AB8.B3AB9.2BAB9.2BAB22.B2AB21.B3AB22.B3AB7.B3AB$17.B11.B25.2B10.BAB
10.2B10.B.B35.3BAB8.3BAB22.BAB63.BAB9.BAB22.B.2B9.2B2AB8.2B2AB9.B2AB
8.B2AB22.BAB23.B2AB22.BA2B8.BABAB$68.B64.B12.B24.B65.B11.B38.2B11.2B 11.2B10.2B24.B25.2B24.B11.B.B6$13.5B8.5B21.4B9.4B9.4B9.4B36.B13.B23.
4B61.3B10.3B23.3B10.B25.3B10.3B75.2B11.B$12.B5AB6.B5AB19.B4AB7.B4AB7. B4AB7.B4AB34.BA2B9.2BAB21.B4AB59.B3AB8.B3AB21.B3AB8.BA2B22.B3AB8.B3AB 73.B2A2B8.BA2B$13.4BAB7.3BAB21.3B2AB7.3BAB8.2B2AB8.BABAB33.B4AB7.B4AB
21.2BAB61.2B2AB8.2B2AB20.BAB2AB7.B3AB22.2BAB9.2BAB74.B3AB7.B3AB$17.B 11.B25.2B10.BAB10.2B10.B.B35.3BAB8.3BAB22.BAB63.BAB9.BAB22.B.2B9.2B2A B22.B2AB8.B2AB74.BA2B8.BABAB$68.B64.B12.B24.B65.B11.B38.2B24.2B10.2B
76.B11.B.B6$13.5B8.5B21.4B9.4B100.4B139.3B10.3B$12.B5AB6.B5AB19.B4AB
7.B4AB98.B4AB137.B3AB8.B3AB$13.4BAB7.3BAB21.3B2AB7.3BAB99.2BAB139.2BA B9.2BAB$17.B11.B25.2B10.BAB100.BAB140.B2AB8.B2AB$68.B102.B142.2B10.2B 6$13.5B47.4B$12.B5AB45.B4AB$13.4BAB46.3BAB$17.B49.BAB$68.B!


wwei23
Posts: 949
Joined: May 22nd, 2017, 6:14 pm
Location: The (Life?) Universe

### Re: Golly scripts

Then this:

Code: Select all

x = 446, y = 125, rule = LifeHistory
3.A2B7.A4B8.A4B10.A2B8.A3B9.A3B9.A3B9.A3B11.AB23.A13.A13.B9.A3B11.AB
48.A2B10.A2B23.A2B10.A13.A11.A2B10.A2B23.A2B23.A13.B11.AB11.A13.A11.
2B$6AB5.B5AB6.B5AB7.5AB6.B4AB7.B4AB7.B4AB7.B4AB8.4AB8.A.AB9.BA2B9.2BA B9.3BAB7.B4AB8.4AB9.2AB11.A10.4AB7.B3AB8.B3AB9.4A8.B3AB8.BA2B10.BAB9. B3AB8.B3AB9.4A8.B3AB9.3A9.BA2B10.2AB9.B2A2B8.BA2B11.AB9.B2AB$13.4BAB
7.3BAB10.A2B8.3B2AB7.3BAB8.2B2AB8.BABAB8.A.BAB8.4AB7.B4AB7.B4AB7.5AB
8.2BAB10.2AB9.4AB7.B5A10.3AB7.2B2AB8.2B2AB9.3AB7.BAB2AB7.B3AB8.B3AB9.
2BAB9.2BAB10.2AB9.B2AB9.4A8.B3AB9.3AB9.B3AB7.B3AB9.3AB9.3A$17.B11.B 11.B13.2B10.BAB10.2B10.B.B12.B11.BAB8.3BAB8.3BAB11.A10.BAB11.B12.AB9. 2BAB11.3B10.BAB9.BAB10.3B9.B.2B9.2B2AB8.2B2AB9.B2AB8.B2AB10.BAB9.BAB 11.2B10.B2AB10.2AB9.BA2B8.BABAB9.ABAB11.2A$68.B51.B12.B12.B24.B25.B
12.B26.B11.B38.2B11.2B11.2B10.2B12.B11.B25.2B24.B11.B.B12.B6$3.BAB7.B A3B8.BA3B10.BAB8.BA2B9.BA2B9.BA2B9.BA2B11.BA23.B13.B13.B9.BA2B11.BA 48.BAB10.BAB23.BAB10.B13.B11.BAB10.BAB23.BAB23.B13.A11.BA11.B13.B11. 2B$6AB5.B5AB6.B5AB7.5AB6.B4AB7.B4AB7.B4AB7.B4AB8.4AB8.A.BA9.B2AB9.2B
2A9.A2BAB7.B4AB8.4AB9.ABA11.A10.3ABA7.B3AB8.B3AB9.3AB8.B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.B2A$17.B11. B11.B13.2B10.BAB10.2B10.B.B12.B11.BAB8.3BAB8.3BAB11.A10.BAB11.B12.AB 9.2BAB11.3B10.BAB9.BAB10.2BA9.B.2B9.2B2AB8.2B2AB9.B2AB8.B2AB10.B2A9.B AB11.AB10.B2AB10.2AB9.BA2B8.BABAB9.ABAB11.2A$68.B51.B12.B12.B24.B25.B
12.A26.B11.B38.2B11.2B11.2B10.2B12.B11.B25.2B24.B11.B.B12.B6$3.3B7.3B AB8.3BAB10.3B8.3BA9.3BA9.3BA9.3BA11.2B23.B13.B13.B9.3BA11.2B48.3B10. 3B23.3B10.B13.B11.3B10.3B23.3B23.B13.B11.2B11.B13.B11.BA$7A5.B5AB6.B
5AB7.6A6.B4AB7.B4AB7.B4AB7.B4AB8.4AB8.A.2B9.BA2B9.2BAB9.2B2AB7.B4AB8.
4AB9.A2B11.A10.3A2B7.B4A8.B4A9.3AB8.B4A8.BA2B10.BAB9.B4A8.B4A9.3AB8.B
4A21.BA2B10.BAB9.B2ABA8.BA2B11.AB9.B2AB$13.4BAB7.3BAB10.A2B8.3B2AB7. 3BAB8.2B2AB8.BABAB8.A.B2A8.4AB7.B5A7.B4AB7.B4AB8.2BAB10.3A9.4AB7.B4AB 10.3AB7.2B2AB8.2B2AB9.3AB7.BAB2AB7.B4A8.B3AB9.2BAB9.2BAB10.2AB9.B2AB 21.B4A9.4A9.B3AB7.B4A9.3AB9.B2A$17.B11.B11.B13.2B10.BAB10.2B10.B.B12.
B11.B2A8.3BAB8.3B2A11.A10.BAB11.B12.2A9.B2AB11.2BA10.BAB9.BAB10.BAB9.
B.2B9.2B2AB8.2B3A9.B2AB8.B2AB10.BAB9.BAB23.B2AB10.2AB9.BA2B8.BABAB9.A
B2A11.2A$68.B51.B12.B12.B24.B25.B12.B26.B11.B38.2B11.2B11.2B10.2B12.A 11.B25.2B24.B11.B.B12.B6$13.4BA8.4BA10.3B8.4B9.4B9.4B9.4B11.2B23.B13.
B13.A9.4B11.2B48.3B10.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.2BAB9.2BAB22.B2AB21.B3AB22.B3AB7.B3AB 9.3AB$17.B11.B11.B13.2B10.BAB10.2B10.B.B12.B11.2AB8.3BAB8.2B2AB11.A
10.BAB35.2BAB11.A2B10.B2A9.B2A22.B.BA9.2B2AB8.2B2AB9.B3A8.B3A22.B2A
23.B2AB22.BABA8.BABAB9.3AB$68.B51.B12.A12.B24.B38.B26.B11.B38.BA11.AB 11.2B10.2B24.B25.BA24.B11.B.A12.B6$13.5B8.5B10.3B8.4B9.4B9.4B9.4B36.B
13.B13.B9.4B61.3B10.3B23.3B10.B13.B11.3B10.3B23.3B23.B25.2B11.B$12.B 5AB6.B5AB7.5AB6.B4AB7.B4AB7.B4AB7.B4AB34.BA2B9.2BAB9.3BAB7.B4AB59.B3A B8.B3AB21.B3AB8.BA2B10.BAB9.B3AB8.B3AB21.B3AB21.BA2B22.B2A2B8.BA2B$
13.4B2A7.3B2A10.A2B8.3B2AB7.3BAB8.2B2AB8.BABAB33.B4AB7.B4AB7.B5A8.2BA
B61.2B2AB8.2B2AB20.BAB2AB7.B3AB8.B3AB9.2BAB9.2BAB22.B2AB21.B3AB22.B3A
B7.B3AB$17.B11.B11.A13.BA10.B2A10.BA10.B.A35.2B2AB8.BABAB11.A10.B2A 63.BAB9.BAB22.B.AB9.2B2AB8.B3AB9.B2AB8.B2AB22.BAB23.B2AB22.B2AB8.B3AB$68.B64.B12.B24.B65.A11.A38.AB11.2B11.BA10.BA24.A25.AB24.B11.B.B6$13. 5B8.5B21.4B9.4B9.4B9.4B36.B13.B23.4B61.3B10.3B23.3B10.B13.B11.3B10.3B 23.3B23.B25.2B11.B$12.B5AB6.B5AB19.B4AB7.B4AB7.B4AB7.B4AB34.BA2B9.2BA
B21.B4AB59.B3AB8.B3AB21.B3AB8.BA2B10.BAB9.B3AB8.B3AB21.B3AB21.BA2B22.
B2A2B8.BA2B$13.4BAB7.3BAB21.3B2AB7.3BAB8.2B2AB8.B3AB33.B4AB7.B4AB21. 2BAB61.2B2AB8.2B2AB20.B4AB7.B3AB8.B3AB9.2BAB9.2BAB22.B2AB21.B3AB22.B 3AB7.B3AB$17.A11.A25.AB10.BAB10.AB10.B.B35.BABAB8.A2BAB22.BAB63.2AB9.
2AB22.B.2B9.B3AB8.AB2AB9.B2AB8.B2AB22.2AB23.3AB22.BA2B8.BABAB$68.A64. B12.B24.A65.B11.B38.2B11.2B11.AB10.AB24.B25.2B24.A11.A.B6$13.5B8.5B
21.4B9.4B9.4B9.4B36.B13.B23.4B61.3B10.3B23.3B10.B13.B11.3B10.3B23.3B
23.B25.2B11.B$12.B5AB6.B5AB19.B4AB7.B4AB7.B4AB7.B4AB34.BA2B9.2BAB21.B 4AB59.B3AB8.B3AB21.B3AB8.BA2B10.BAB9.B3AB8.B3AB21.4AB21.BA2B22.B2A2B 8.BA2B$13.3B2AB7.2B2AB21.2B3AB7.3BAB8.B3AB8.BABAB33.B4AB7.5AB21.2BAB
61.B3AB8.B3AB20.BAB2AB7.B3AB8.4AB9.2BAB9.2BAB22.B2AB21.4AB22.B3AB7.B
3AB$17.B11.B25.2B10.2AB10.2B10.A.B35.A2BAB8.3BAB22.2AB63.BAB9.BAB22.A .2B9.AB2AB8.2B2AB9.3AB8.3AB22.BAB23.B2AB22.2A2B8.2ABAB$68.B64.B12.B
24.B65.B11.B38.2B11.2B11.2B10.2B24.B25.2B24.B11.B.B6$13.5B8.5B21.4B9. 4B9.4B9.4B36.B13.B23.4B61.3B10.3B23.3B10.B13.B11.3B10.3B23.A2B23.B25. 2B11.B$12.B5AB6.B5AB19.B4AB7.B4AB7.B4AB7.B4AB34.BA2B9.ABAB21.B4AB59.B
3AB8.B3AB21.B3AB8.BA2B10.2AB9.B3AB8.B3AB21.B3AB21.2A2B22.B2A2B8.BA2B$13.2BABAB7.BABAB21.BAB2AB7.2B2AB8.AB2AB8.2ABAB33.5AB7.B4AB21.B2AB61.A B2AB8.AB2AB20.2AB2AB7.4AB8.B3AB9.B2AB9.ABAB22.B2AB21.B3AB22.4AB7.4AB$
17.B11.B25.2B10.BAB10.2B10.B.B35.3BAB8.3BAB22.BAB63.BAB9.BAB22.B.2B9.
2B2AB8.2B2AB9.B2AB8.B2AB22.BAB23.B2AB22.BA2B8.BABAB$68.B64.B12.B24.B 65.B11.B38.2B11.2B11.2B10.2B24.B25.2B24.B11.B.B6$13.5B8.5B21.4B9.4B9.
4B9.4B36.B13.B23.4B61.3B10.3B23.3B10.B25.3B10.3B75.2B11.B$12.B5AB6.B 5AB19.B4AB7.B4AB7.5AB7.5AB34.2A2B9.B2AB21.B4AB59.4AB8.4AB21.4AB8.2A2B 22.B3AB8.4AB73.3A2B8.2A2B$13.BA2BAB7.A2BAB21.A2B2AB7.BABAB8.2B2AB8.BA
BAB33.B4AB7.B4AB21.ABAB61.2B2AB8.2B2AB20.BAB2AB7.B3AB22.ABAB9.2BAB74.
B3AB7.B3AB$17.B11.B25.2B10.BAB10.2B10.B.B35.3BAB8.3BAB22.BAB63.BAB9.B AB22.B.2B9.2B2AB22.B2AB8.B2AB74.BA2B8.BABAB$68.B64.B12.B24.B65.B11.B
38.2B24.2B10.2B76.B11.B.B6$13.5B8.5B21.4B9.4B100.4B139.3B10.A2B$12.B
5AB6.6AB19.5AB7.B4AB98.5AB137.4AB8.B3AB$13.A3BAB7.3BAB21.3B2AB7.A2BAB 99.2BAB139.2BAB9.2BAB$17.B11.B25.2B10.BAB100.BAB140.B2AB8.B2AB$68.B 102.B142.2B10.2B6$13.5B47.4B$12.6AB45.5AB$13.4BAB46.3BAB$17.B49.BAB$
68.B!


wwei23
Posts: 949
Joined: May 22nd, 2017, 6:14 pm
Location: The (Life?) Universe

### Re: Golly scripts

Using the Generations rule 012345678//3, we convert blue to black and then back to LifeHistory:

Code: Select all

x = 446, y = 124, rule = LifeHistory
3.A9.A12.A14.A10.A12.A12.A12.A14.A24.A13.A23.A14.A49.A12.A25.A12.A13.
A11.A12.A25.A25.A25.A12.A13.A$6A7.5A8.5A8.5A8.4A9.4A9.4A9.4A9.4A9.A.A 11.A13.A13.A9.4A9.4A10.2A12.A10.4A9.3A10.3A10.4A9.3A10.A13.A11.3A10. 3A10.4A9.3A10.3A10.A12.2A11.2A11.A13.A11.2A$17.A11.A11.A13.2A11.A11.
2A10.A.A9.A2.A9.4A9.4A9.4A8.5A11.A11.2A10.4A9.5A10.3A10.2A11.2A10.3A
9.A.2A9.3A10.3A12.A12.A11.2A11.2A10.4A9.3A10.3A11.3A9.3A10.3A10.3A$68.A51.A12.A12.A12.A11.A25.A12.A26.A11.A38.2A11.2A11.2A10.2A12.A11.A 25.2A11.2A11.A11.A.A10.A.A12.2A7$4.A9.A12.A14.A10.A12.A12.A12.A14.A
62.A14.A49.A12.A25.A38.A12.A25.A38.A12.A$6A7.5A8.5A8.5A8.4A9.4A9.4A9. 4A9.4A9.A2.A10.2A12.2A9.A2.A9.4A9.4A10.A.A11.A10.3A.A8.3A10.3A10.3A 10.3A10.2A12.2A10.3A10.3A10.3A10.3A10.3A10.2A12.A11.2A11.2A12.2A9.3A$
17.A11.A11.A13.2A11.A11.2A10.A.A9.A2.A9.4A9.4A9.4A9.4A11.A11.2A10.4A
9.4A11.3A10.2A11.2A10.4A8.A.2A9.3A10.3A12.A12.A11.3A10.2A10.3A10.3A
10.3A11.3A9.3A10.3A11.2A$68.A51.A12.A12.A12.A11.A25.A12.2A25.A11.A38. 2A11.2A11.2A10.2A12.A11.A13.A11.2A11.2A11.A11.A.A10.A.A12.2A7$5.A9.A
12.A14.A10.A12.A12.A12.A77.A64.A12.A25.A38.A12.A25.A88.A$6A7.5A8.5A8. 5A8.4A9.4A9.4A9.4A9.5A8.A13.A.A11.A11.A.A9.4A9.5A9.A13.A10.3A10.3A10. 3A10.3A10.3A10.A.A11.A11.3A10.3A10.3A10.3A10.3A10.A.A11.2A10.3A10.A.A 11.A11.2A$17.A11.A11.A13.2A11.A11.2A10.A.A9.A2.A9.5A8.4A9.5A8.4A11.A
11.2A10.5A8.4A11.4A9.2A11.2A10.3A9.A.2A9.3A10.4A11.A12.A11.2A11.2A10.
3A10.3A10.3A11.3A9.3A10.4A10.2A$68.A51.A12.A12.A12.A11.A25.A12.A26.A 11.A13.A24.2A11.2A11.2A10.2A12.2A10.A12.A12.2A11.2A11.A11.A.A10.A.A 12.2A$210.A6$16.A12.A25.A12.A12.A12.A77.A270.A$7A6.5A8.5A8.6A7.4A9.4A
9.4A9.4A9.4A9.A13.A13.A12.2A9.4A9.4A10.A13.A10.3A10.4A9.4A9.3A10.4A9.
A13.A11.4A9.4A9.3A10.4A22.A13.A11.2A.A9.A13.A11.2A$17.A11.A11.A13.2A 11.A11.2A10.A.A9.A2.2A8.4A9.5A8.4A9.4A11.A11.3A9.4A9.4A11.3A10.2A11. 2A10.3A9.A.2A9.4A9.3A12.A12.A11.2A11.2A23.4A9.4A10.3A9.4A9.3A11.2A$
68.A51.2A11.A12.2A11.A11.A25.2A10.2A14.A11.A11.A12.A25.2A11.3A10.2A
10.2A12.A11.A25.2A11.2A11.A11.A.A10.A.2A11.2A$340.A6$17.A12.A128.A$13.5A8.5A8.5A8.5A8.5A8.5A8.5A8.4A9.A13.A13.A13.A9.5A8.4A10.A13.A10.3A 10.3A10.3A10.3A10.3A10.A13.A11.3A10.3A10.3A10.3A23.A13.A11.2A11.A13.A 11.3A$17.A11.A11.A.A11.2A11.A11.2A10.A.A9.A2.A9.4A9.4A9.4A9.4A11.A11.
2A10.4A9.4A11.3A10.3A10.3A9.3A9.A.3A8.3A10.3A12.2A11.2A10.2A11.3A22.
3A10.3A11.4A8.3A10.3A11.2A$68.A38.A12.A12.2A11.A12.A11.A12.A12.A10.A. A13.A12.A11.A11.A26.3A10.2A11.2A10.2A11.2A11.A25.3A10.3A10.A11.A.2A9. A.A12.2A$120.A25.A50.A104.A128.A7$13.6A7.6A7.5A8.4A9.4A9.4A9.4A9.4A9. A13.A13.A13.2A8.4A37.A10.3A10.3A10.3A23.3A10.A13.A11.3A10.3A23.3A23.A 25.2A11.A13.A$17.A11.A11.2A12.3A10.2A10.3A9.A.2A8.A.2A9.4A9.4A9.4A9.
4A11.2A34.5A11.3A10.2A11.2A22.A.2A9.3A10.3A12.A12.A24.2A23.3A24.3A9.
3A10.3A$68.A50.2A12.A11.2A12.A11.A38.A12.A13.2A10.2A25.A11.2A11.2A11. 3A9.3A23.2A24.2A24.A.A9.A.A10.3A$133.A155.A11.A77.A38.A7$13.5A8.5A8. 5A8.4A9.4A9.4A9.4A36.A13.A13.A9.4A61.3A10.3A23.3A10.A13.A11.3A10.3A 23.3A23.A25.2A11.A$17.2A10.2A10.A13.2A11.A11.2A10.A.A35.4A9.4A9.5A10.
A64.2A11.2A22.A.2A9.3A10.3A12.A12.A24.2A23.3A24.3A9.3A$41.A14.A11.2A 11.A12.A37.2A10.A.A12.A11.2A64.A11.A25.A12.2A10.3A11.2A10.2A24.A25.2A 24.2A10.3A$237.A11.A38.A26.A11.A24.A25.A7$13.5A8.5A21.4A9.4A9.4A9.4A 36.A13.A23.4A61.3A10.3A23.3A10.A13.A11.3A10.3A23.3A23.A25.2A11.A$17.A
11.A25.2A11.A11.2A10.3A35.4A9.4A24.A64.2A11.2A22.4A9.3A10.3A12.A12.A
24.2A23.3A24.3A9.3A$17.A11.A25.A12.A11.A50.A.A9.A2.A24.A64.2A10.2A37. 3A9.A.2A11.2A10.2A23.2A24.3A24.A11.A.A$68.A102.A142.A11.A77.A11.A7$13.5A8.5A21.4A9.4A9.4A9.4A36.A13.A23.4A61.3A10.3A23.3A10.A13.A11.3A 10.3A22.4A23.A25.2A11.A$16.2A10.2A24.3A11.A10.3A10.A.A35.4A8.5A24.A
63.3A10.3A22.A.2A9.3A9.4A12.A12.A24.2A22.4A24.3A9.3A$67.2A23.A37.A2.A 12.A23.2A65.A11.A23.A12.A.2A11.2A10.3A9.3A24.A25.2A23.2A10.2A.A7$351.
A$13.5A8.5A21.4A9.4A9.4A9.4A36.A11.A.A23.4A61.3A10.3A23.3A10.A12.2A 11.3A10.3A23.3A22.2A25.2A11.A$15.A.A9.A.A23.A.2A10.2A9.A.2A9.2A.A34.
5A9.4A23.2A62.A.2A9.A.2A21.2A.2A8.4A10.3A11.2A10.A.A24.2A23.3A23.4A8.
4A$68.A64.A12.A24.A65.A11.A38.2A11.2A11.2A10.2A24.A25.2A24.A11.A.A8$
13.5A8.5A21.4A9.4A8.5A8.5A35.2A12.2A23.4A60.4A9.4A22.4A9.2A25.3A9.4A
74.3A10.2A$14.A2.A8.A2.A22.A2.2A9.A.A11.2A10.A.A35.4A9.4A22.A.A64.2A 11.2A22.A.2A9.3A23.A.A12.A76.3A9.3A$68.A64.A12.A24.A65.A11.A38.2A24.
2A10.2A76.A11.A.A7$325.A$13.5A7.6A20.5A9.4A99.5A138.4A10.3A$13.A3.A 11.A25.2A8.A2.A102.A142.A12.A$68.A102.A142.2A10.2A8$12.6A46.5A$17.A
50.A\$68.A!