Script request thread
Re: Script request thread
A program for searching for ancestors of a certain pattern that fit within a certain bounding box or have fewer than a certain amount of cells.
Re: Script request thread
Have you tried JavaLifeSearch, or the older Windows version WLS? They can perform those tasks fairly well, depending on exactly what you want.
- creeperman7002
- Posts: 257
- Joined: December 4th, 2018, 11:52 pm
Re: Script request thread
Can rlifesrc have a feature that skips solutions containing non-interacting objects?
B2n3-jn/S1c23-y is an interesting rule. It has a replicator, a fake glider, an OMOS and SMOS, a wide variety of oscillators, and some signals. Also this rule is omniperiodic.
viewtopic.php?f=11&t=4856
viewtopic.php?f=11&t=4856
- Entity Valkyrie 2
- Posts: 1008
- Joined: February 26th, 2019, 7:13 pm
- Location: Hijuatl, Zumaland
- Contact:
Re: Script request thread
Is there a script that can turn a pattern into a static png?
Bx222 IS MY WORST ENEMY.
Please click here for my own pages.
My recent rules:
B3-kq4ej5i6ckn7e/S2-i34q6a7
B3-kq4ej5y6c/S2-i34q5e
Move the Box
Please click here for my own pages.
My recent rules:
B3-kq4ej5i6ckn7e/S2-i34q6a7
B3-kq4ej5y6c/S2-i34q5e
Move the Box
Re: Script request thread
This Lua script will save the current pattern into Golly's temp folder as "pattern.png". Maximum pattern size is 4096 x 4096.Entity Valkyrie 2 wrote: ↑April 4th, 2021, 3:06 amIs there a script that can turn a pattern into a static png?
Code: Select all
-- Save current pattern as a PNG
--
-- Author:
-- Chris Rowett (crowett@gmail.com)
local g = golly()
local gp = require "gplus"
require "gplus.strict"
-- overlay
local ov = g.overlay
local overlaycreated = false
-- temporary file path
local temppath = g.getdir("temp")
--------------------------------------------------------------------------------
local function savepng()
-- get the bounding box of the pattern
local box = g.getrect()
if #box == 0 then
g.note("There is no pattern.")
else
-- get the size of the pattern
local x, y, wd, ht = table.unpack(box)
local cwd = wd
local cht = ht
-- cellview width and height must be multiples of 16
if cwd & 15 ~= 0 then
cwd = ((cwd // 16) + 1) * 16
end
if cht & 15 ~= 0 then
cht = ((cht // 16) + 1) * 16
end
-- check the width or height are not bigger than the cellview maximum
if wd > 4096 or ht > 4096 then
g.note("Pattern too big! Maximum is 4096x4096.")
else
-- create the overlay
ov("create "..cwd.. " "..cht)
overlaycreated = true
-- draw the pattern onto the overlay
ov("cellview "..x.." "..y.." "..cwd.." "..cht)
ov("drawcells")
ov("update")
-- save the overlay as a PNG
local savefile = temppath.."pattern.png"
ov("save 0 0 "..wd.." "..ht.." "..savefile)
-- delete overlay
ov("delete")
g.update()
overlaycreated = false
g.note("Saved pattern of size "..wd.."x"..ht.." to "..savefile)
end
end
end
--------------------------------------------------------------------------------
local status, err = xpcall(savepng, gp.trace)
if err then g.continue(err) end
-- this code is always executed, even after escape/error;
-- clear message line in case there was no escape/error
g.check(false)
if overlaycreated then ov("delete") end
LifeViewer https://lazyslug.com/lifeviewer
- GUYTU6J
- Posts: 1343
- Joined: August 5th, 2016, 10:27 am
- Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
- Contact:
Re: Script request thread
LifeWiki Help:Images says that you can just use the standard giffer.py with Number of generations = 1, then open the resulting .gif in any image-editing program and save as .png.Entity Valkyrie 2 wrote: ↑April 4th, 2021, 3:06 amIs there a script that can turn a pattern into a static png?
BTW in Special:UnusedFiles you can see lots of blur gray-background images (both static and animated) by exactly you. Would you mind deleting them so as to save storage space?
Lifequote:
Stop Japan from pouring nuclear waste!
I'm afraid there's arrival but no departure.In the drama The Peony Pavilion, Tang Xianzu wrote: 原来姹紫嫣红开遍,似这般都付与断井颓垣。
(Here multiflorate splendour blooms forlorn
Midst broken fountains, mouldering walls.)
Stop Japan from pouring nuclear waste!
-
- Posts: 23
- Joined: January 26th, 2021, 12:19 am
Re: Script request thread
Would anyone mind writing a script that enumerates every collision of 2 of a given ship?
I wrote random rule generators for 3-State Outer-Totalistic rules and for 2-State Isotropic Non-Totalistic rules!
I created a notation for the 3-State Isotropic Non-Totalistic rulespace and wrote a generator for it!
I created a notation for the 3-State Isotropic Non-Totalistic rulespace and wrote a generator for it!
Re: Script request thread
I think there was one; but I can’t remember what it is.Cyclotrons wrote: ↑April 6th, 2021, 11:25 amWould anyone mind writing a script that enumerates every collision of 2 of a given ship?
B34kz5e7c8/S23-a4ityz5k!!!
b2n3-q5y6cn7s23-k4c8
B3-kq6cn8/S2-i3-a4ciyz8
wiki
Spamming in sandbox is better than spamming in the OCA.
b2n3-q5y6cn7s23-k4c8
B3-kq6cn8/S2-i3-a4ciyz8
wiki
Spamming in sandbox is better than spamming in the OCA.
- goldenratio
- Posts: 285
- Joined: July 26th, 2020, 10:39 pm
Re: Script request thread
Here you go! Note that this only works on diagonal ships. (I'm making one for orthogonal ships.) Before using, make a layer with the ship you want to collide traveling southwest.Cyclotrons wrote: ↑April 6th, 2021, 11:25 amWould anyone mind writing a script that enumerates every collision of 2 of a given ship?
Code: Select all
import golly as g
shippattern = g.getcells(g.getrect())
layerindex = g.getlayer()
collideship = []
popseq1 = []
popseq2 = []
g.addlayer()
g.setname("Ship collider space")
g.putcells(shippattern)
box = g.getrect()
g.select(g.getrect())
g.flip(1)
# For perpendicular collisions
flipship = g.getcells(g.getrect())
g.addlayer()
g.setname("Ship evolving space")
g.putcells(flipship)
g.addlayer()
g.setname("Collisions")
g.setlayer(layerindex + 2)
# Find the spaceship period
shiphash = g.hash(g.getrect())
period = 0
while True:
g.run(1)
period += 1
if g.hash(g.getrect()) == shiphash:
break
if period > 500:
g.exit("Period is too large! Are you sure the pattern is a spaceship?")
g.reset()
shipseq = [0] * period
def clear_layer():
r = g.getrect()
if r:
g.select(r)
g.clear(0)
return
# Checks if two spaceships interact.
def interact():
popseq = [[0] * 10] * period
for j in range(10):
for i in range(period):
g.run(1)
popseq[i][j] = int(g.getpop())
notequal = False
for j in range(10):
for i in range(period):
if popseq[i][j] != shipseq[i]:
notequal = True
if notequal == False:
return False
else:
return True
g.reset()
# Enumerating collisions
def putcollision(orientation, i, j):
if interact() == True:
g.reset()
collision = g.getcells(g.getrect())
g.setlayer(layerindex + 3)
if orientation == 0:
g.putcells(collision, 100 * j, - 100 * i)
else:
g.putcells(collision, 100 * j, 100 * i + 100)
g.setlayer(layerindex + 1)
g.reset()
def makecollision():
g.setlayer(layerindex + 1)
for i in range(period):
g.setlayer(layerindex + 2)
g.run(1)
collideship = g.getcells(g.getrect())
g.setlayer(layerindex + 1)
clear_layer()
g.putcells(shippattern)
g.putcells(collideship, 500, 500)
for k in range(period):
shipseq[k] = int(g.getpop())
for j in range(box[2] * 8):
g.reset()
clear_layer()
# Perpendicular collisions
g.putcells(shippattern, 0, 0)
g.putcells(collideship, j - 3 * box[2], box[3] + 3)
putcollision(0, i, j)
# Head-on collisions
g.select(box)
g.flip(0)
putcollision(1, i, j)
def deletelayers():
g.setlayer(layerindex + 1)
g.dellayer()
g.setlayer(layerindex + 1)
g.dellayer()
makecollision()
deletelayers()
For larger ships, lines 45, 46, and 51 might need to be modified to allow later interactions.
Currently fairly inactive here, but working on a few big projects. Prepare for surprise, I hope.
Re: Script request thread
Can someone make a script that generates collisions between a NW travelling glider and 2 upward travelling LWSSs? And before it generates those collisions it
Can someone make a script that does this?
Step 1: Generate all combinations of 2 upward LWSSs at a certain distance from each other (they can also be different phases from each other).
Step 2: Generate all combinations of a NW travelling glider colliding with all the combinations of the upward LWSS generated from the previous step.
Step 3: Filter the output of step 2 so the only combinations left from step 2are ones where a NW glider collides with an LWSS pair, then gets reflected into a NE travelling glider without any leftover ash.
Example of a combination of 2 Upward LWSSs + NW glider = NE glider:
EDIT March 12: I was finally able to get gencols working so I will use gencols for each step.
Can someone make a script that does this?
Step 1: Generate all combinations of 2 upward LWSSs at a certain distance from each other (they can also be different phases from each other).
Step 2: Generate all combinations of a NW travelling glider colliding with all the combinations of the upward LWSS generated from the previous step.
Step 3: Filter the output of step 2 so the only combinations left from step 2are ones where a NW glider collides with an LWSS pair, then gets reflected into a NE travelling glider without any leftover ash.
Example of a combination of 2 Upward LWSSs + NW glider = NE glider:
Code: Select all
x = 9, y = 17, rule = B3/S23
7b2o$6b2o$8bo$bo$3o$ob2o$b3o$b2o5$3bo$2b3o$2bob2o$3b3o$3b2o!
EDIT March 12: I was finally able to get gencols working so I will use gencols for each step.
Puffer Suppressor
Would we be able to know when we know everything there is to know?
How would we know what we don’t know that we don’t know?
Still working on the (34,7)c/156 caterpillar <- HELP WANTED!
Would we be able to know when we know everything there is to know?
How would we know what we don’t know that we don’t know?
Still working on the (34,7)c/156 caterpillar <- HELP WANTED!
- LaundryPizza03
- Posts: 1239
- Joined: December 15th, 2017, 12:05 am
- Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"
Re: Script request thread
A script to convert EnumPattEvo output to an sss file. Attached is a partial sample run which found 373 ships in a B2a rulespace.
Code: Select all
x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
The latest edition of new-gliders.db.txt and oscillators.db.txt have 31531 spaceships and 1293 oscillators from outer-totalistic rules. You are invited to help!