I have found a rule that simulates Bliptile called B4rt5cijkn6-en7c8/S0123-cn4-ny5-kr67c8
Actually the metacells can be closer, and when the metacells are on a line, their wings can be reduced like this:
This is very inconvenient because the signal can't be converted.
Code: Select all
local g = golly()
local gp = require "gplus"
local split = gp.split
local pattern = gp.pattern
local selrect = g.getselrect()
if #selrect == 0 then g.exit("There is no selection.") end
local r = gp.rect(selrect)
local selr = {}
selr[-1] = {}
selr[r.right - r.left + 1] = {}
for j = r.top, r.bottom do
selr[-1][j - r.top] = 0
selr[r.right - r.left + 1][j - r.top] = 0
end
for i = r.left, r.right do
selr[i - r.left] = {}
selr[i - r.left][-1] = 0
selr[i - r.left][r.bottom - r.top + 1] = 0
for j = r.top, r.bottom do
selr[i - r.left][j - r.top] = g.getcell(i,j)
if selr[i - r.left][j - r.top] ~= 0 then
selr[i - r.left][j - r.top] = 1
else selr[i - r.left][j - r.top] = 0 end
end
end
-- check that a layer is available for the metafied pattern;
-- if metafied layer already exists then we'll use that
local layername = "metafied bliptile"
local metalayer = -1
local i
for i= 0,g.numlayers()-1 do
if g.getname(i) == layername then metalayer = i break end
end
if metalayer < 0 and g.numlayers() == g.maxlayers() then g.exit("Delete a layer.") end
-- note that getrule returns canonical rule string
rulestr, _ = split(g.getrule(),":")
if rulestr ~= "Bliptile" then
g.exit("This script only works with Bliptile.")
end
-- get the current selection
local slist = g.getcells(selrect)
local selwidth = selrect[3]
local selheight = selrect[4]
-- create metafied pattern in separate layer
if metalayer >= 0 then
g.setlayer(metalayer) -- switch to existing layer
else
metalayer = g.addlayer() -- create new layer
end
g.new(layername)
g.setalgo("QuickLife")
g.setrule("B4rt5cijkn6-en7c8/S0123-cn4-ny5-kr67c8")
-- local metacell = pattern("2b3o$2b3o$7o$7o$7o$2b3o$2b3o!")
local metacell = {3,-1,3,0,3,1,2,-1,2,0,2,1,
1,-3,1,-2,1,-1,1,0,1,1,1,2,1,3,
0,-3,0,-2,0,-1,0,0,0,1,0,2,0,3,
-1,-3,-1,-2,-1,-1,-1,0,-1,1,-1,2,-1,3,
-2,-1,-2,0,-2,1,-3,-1,-3,0,-3,1}
local lrmeta = {1,-3,1,-2,1,-1,1,0,1,1,1,2,1,3,
0,-3,0,-2,0,-1,0,0,0,1,0,2,0,3,
-1,-3,-1,-2,-1,-1,-1,0,-1,1,-1,2,-1,3}
local udmeta = {3,-1,3,0,3,1,2,-1,2,0,2,1,
1,-1,1,0,1,1,0,-1,0,0,0,1,-1,-1,-1,0,-1,1,
-2,-1,-2,0,-2,1,-3,-1,-3,0,-3,1}
local nowmeta
for j=0,selheight-1 do
for i=0,selwidth-1 do
if selr[i][j]==1 then
nowmeta = metacell
if selr[i][j-1] == 0 and selr[i][j+1] == 0 then nowmeta = udmeta end
if selr[i-1][j] == 0 and selr[i+1][j] == 0 then nowmeta = lrmeta end
g.putcells(nowmeta, 5 * i, 5 * j)
end
end
end
g.update()
g.fit()
g.show("Filled.") -- no point running a metapattern without hashing
g.step() -- save start and populate hash tables