EDIT 6/30/2017: Back in April the bit table in the rule-integer docs was officially rotated 180 degrees so that the most significant bit is in the upper left-hand corner, where it (maybe) belongs.
These test patterns come from an early alternate universe where the most significant bit was in the lower right corner. So in the test pattern comments, East is West and Northwest is Southeast, and so on. And vice versa. Try not to be confused for too long...
dvgrn wrote:Some evening this week I'll maybe get around to changing a few bits to make this a proper asymmetric non-totalistic test case -- and also fixing my
generator script so it gives the right answer for B0 and/or S8 rules (or at least notices and complains about them).
Well, my timeframe was a little unrealistic, but I'm still on the job. This version of the generator script --
Code: Select all
-- make_nontotalistic_LifeViewer_rulestring_v1.0.lua
local g = golly()
local gp = require "gplus"
local split = gp.split
-- local pattern = gp.pattern
function fixrule(s)
return (gp.split(s,":")) -- remove bounded grid spec, if any
end
g.addlayer("temp") -- keep and test the current rule
fixedrule=fixrule(g.getrule())
g.setrule(fixedrule)
bitlist={{-1,-1,1},{0,-1,2},{1,-1,4},{-1,0,8},{0,0,16},{1,0,32},{-1,1,64},{0,1,128},{1,1,256}}
for j = 1, 9 do
x, y, bit = table.unpack(bitlist[j])
for i=0, 511 do
if i&bit>0 then g.setcell(i*5+x,y,1) end
end
end
g.run(1)
bits={}
ind=1
local rulestr, invstr, revinvstr="","",""
for k=0,2555,5 do
if g.getcell(k,0)==1 then
rulestr=rulestr.."1"
invstr=invstr.."0"
revinvstr="0"..revinvstr
else
rulestr=rulestr.."0"
invstr=invstr.."1"
revinvstr="1"..revinvstr
end
end
-- build base64 lookup table
local lookupstr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
bdict={}
for i=1,64 do
local w=""
for j=0,5 do
if (i-1)&2^j>0 then w="1"..w else w="0"..w end
end
bdict[w]=lookupstr:sub(i,i)
end
-- decide whether to use standard, inverted, or inverted-reversed bitstring, based on fixedrule
-- (assuming Golly is correctly simulating rules with B0, with or without S8, to avoid strobing)
-- the following won't work for anisotropic non-totalistic rules defined by MAP strings,
-- so we'll have to decode the MAP rulestring into a 512-bit string in that case, check first and last digits...
-- but in that case, we already know the string, so why are we running this script anyway?
if string.match(fixedrule,"B0") then rulestr = string.match(fixedrule,"S.*8") and revinstr or invstr end
local s = rulestr.."0000" -- pad so that len mod 6=0
base64=""
for i=1,511,6 do base64=base64..bdict[s:sub(i,i+5)] end
g.setclipstr(rulestr.."\n"..base64)
g.show("Copied to clipboard: "..base64)
-- Life = 'ARYXfhZofugWaH7oaIDogBZofuhogOiAaIDogIAAgAAWaH7oaIDogGiA6ICAAIAAaIDogIAAgACAAIAAAAAAAA'
-- does fine for the N and S directions. Here's the N version: cells appear to move south because they only turn ON when the north neighbor is on.
Code: Select all
#C minimal anisotropic rule where the neighbor to the north (only) triggers a birth
x = 34, y = 22
o9bo9bo9bo$bo9bo9bo$2bo9bo$3bo$4bo15bo$5bo13bo$6bo11bo5bo$7bo9bo5bo$8b
o7bo5bo4bo$9bo5bo5bo4bo$o13bo5bo4bo4bo$13bo15bo$33bo2$5bo8bo$4b3o$3b5o
$4b3o12b2o$5bo13b2o$27b3o$o9bo16b3o$27b3o!
#C [[ MAP IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ]]
#C 00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
However, there's something odd going on for the other six directions. Here's AnisotropicTestSW translated by the script, for example:
Code: Select all
#C minimal anisotropic rule where the neighbor to the southwest (only) triggers a birth
x = 34, y = 22
o9bo9bo9bo$bo9bo9bo$2bo9bo$3bo$4bo15bo$5bo13bo$6bo11bo5bo$7bo9bo5bo$8b
o7bo5bo4bo$9bo5bo5bo4bo$o13bo5bo4bo4bo$13bo15bo$33bo2$5bo8bo$4b3o$3b5o
$4b3o12b2o$5bo13b2o$27b3o$o9bo16b3o$27b3o!
#C [[ MAP AAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ]]
#C 00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
"AAAAAAAAAAC" puts a 1 in position #64 in the 512-bit string (counting the first bit as position #0) so that matches the SW neighbor in
the diagram. But when you run it in LifeViewer, it behaves as if only SE neighbors cause a birth.
It's trivial to swap the X coordinates in the "bitlist" lookup table, so that the Lua script makes a LifeViewer MAP string that produces the correct behavior. But really I *think* my code is correct, which means that there's something backward in LifeViewer. Here's another test case, generated by the script from AnisotropicTestE.rule:
Code: Select all
#C x = 34, y = 22, rule = AnisotropicTestE:T50,50
x = 34, y = 22
o9bo9bo9bo$bo9bo9bo$2bo9bo$3bo$4bo15bo$5bo13bo$6bo11bo5bo$7bo9bo5bo$8b
o7bo5bo4bo$9bo5bo5bo4bo$o13bo5bo4bo4bo$13bo15bo$33bo2$5bo8bo$4b3o$3b5o
$4b3o12b2o$5bo13b2o$27b3o$o9bo16b3o$27b3o!
#C [[ MAP AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ]]
#C 00000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
The script produces the following test pattern (except in the AnisotropicTestE rule, without the multiple states) -- and then only the #32 central cell turns on when it's run for a tick, so the script puts out "AAAAAAI":
Code: Select all
x = 2557, y = 73, rule = LifeHistory
160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$
160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$
160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$
160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$160.B$
160.B$160.B$160.B$160.B$160.B$160.B$144.B15.B15.B$145.B14.B14.B$146.B
13.B13.B$147.B12.B12.B$148.B11.B11.B$149.B10.B10.B$150.B9.B9.B$151.B
8.B8.B$152.B7.B7.B$153.B6.B6.B$154.B5.B5.B$155.B4.B4.B$156.B3.B3.B$
157.B2.B2.B$158.B.B.B$159.3B$160.B4$4.A5.A3.2A5.A2.A.A3.2A2.3A7.A5.A
3.2A5.A2.A.A3.2A2.3A7.A5.A3.2A5.A2.A.A3.2A2.3A7.A5.A3.2A5.A2.A.A3.2A
2.3A7.A5.A3.2A5.A2.A.A3.2A2.3A7.A5.A3.2A5.A2.A.A3.2A2.3A7.A5.A3.2A5.A
2.A.A3.2A2.3A7.A5.A3.2A5.A2.A.A3.2A2.3A7.A5.A3.2A5.A2.A.A3.2A2.3A7.A
5.A3.2A5.A2.A.A3.2A2.3A7.A5.A3.2A5.A2.A.A3.2A2.3A7.A5.A3.2A5.A2.A.A3.
2A2.3A7.A5.A3.2A5.A2.A.A3.2A2.3A7.A5.A3.2A5.A2.A.A3.2A2.3A7.A5.A3.2A
5.A2.A.A3.2A2.3A7.A5.A3.2A5.A2.A.A3.2A2.3A7.A5.A3.2A5.A2.A.A3.2A2.3A
7.A5.A3.2A5.A2.A.A3.2A2.3A7.A5.A3.2A5.A2.A.A3.2A2.3A7.A5.A3.2A5.A2.A.
A3.2A2.3A7.A5.A3.2A5.A2.A.A3.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.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.
A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A
.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.
A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A2.A.A
2.A.A2.A.A2.A.A2.A.A2.A.A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A
3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A
3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A
3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A3.2A
3.2A3.2A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A
2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A
2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A
2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A2.3A!
Have I got my thinking backwards somehow, or is this just somebody
inventing new arbitrary coordinate systems again? If so, one possible fix would be to adjust the documentation:
Code: Select all
Neighbourhood
2 1 0
5 4 3 -> 4'
8 7 6
- AnisotropicTestRules.zip
- Minimal anisotropic rules. All are named after the neighbor that causes a birth -- so cells appear to move in the opposite of the named direction
- (2.7 KiB) Downloaded 15 times