Thread for your script-related questions

For scripts to aid with computation or simulation in cellular automata.
User avatar
dvgrn
Moderator
Posts: 7863
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Thread for your script-related questions

Post by dvgrn » March 29th, 2021, 8:09 am

PkmnQ wrote:
March 29th, 2021, 7:37 am
I know of a script that turns patterns to apgcodes, but is there a script that turns apgcodes to patterns?
This script by Ilmari Karonen seems to fit the bill. I haven't tested it, but the comments show a good level of awareness of the different apgcode variants.

Tangential note: I knew the name "Ilmari Karonen" was familiar, but I had no idea why. Turns out one of my first blog posts was about a question he asked on the comp.theory.cell-automata newsgroup, which was more or less the public predecessor of the conwaylife.com forums.

I didn't even remember that I had started that blog that early (first post in late 2004). Memories of that time are very hazy -- had electricity even been invented back then, let alone the Internet? It's clear from the pattern format that this was before LifeViewer's time, at least.

User avatar
PkmnQ
Posts: 1136
Joined: September 24th, 2018, 6:35 am
Location: Server antipode

Re: Thread for your script-related questions

Post by PkmnQ » March 29th, 2021, 8:22 am

dvgrn wrote:
March 29th, 2021, 8:09 am
PkmnQ wrote:
March 29th, 2021, 7:37 am
I know of a script that turns patterns to apgcodes, but is there a script that turns apgcodes to patterns?
This script by Ilmari Karonen seems to fit the bill. I haven't tested it, but the comments show a good level of awareness of the different apgcode variants.

Tangential note: I knew the name "Ilmari Karonen" was familiar, but I had no idea why. Turns out one of my first blog posts was about a question he asked on the comp.theory.cell-automata newsgroup, which was more or less the public predecessor of the conwaylife.com forums.

I didn't even remember that I had started that blog that early (first post in late 2004). Memories of that time are very hazy -- had electricity even been invented back then, let alone the Internet? It's clear from the pattern format that this was before LifeViewer's time, at least.
I can't even load in a loafer.
Random posts isn't the problem, toxicity is. Don't be toxic.

Anyway, I created a CA which has a lot of infinte growths.

User avatar
dvgrn
Moderator
Posts: 7863
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Thread for your script-related questions

Post by dvgrn » March 29th, 2021, 8:30 am

PkmnQ wrote:
March 29th, 2021, 8:22 am
I can't even load in a loafer.
Why not, exactly? Please try being more specific in bug reports -- it seems silly to have to go through several cycles of posts to painfully extract the relevant information from people.

I saved the script to Golly's Scripts/Python directory, entered "xq7_3nw17862z6952", and ended up with a downward-traveling loafer, as expected.

User avatar
PkmnQ
Posts: 1136
Joined: September 24th, 2018, 6:35 am
Location: Server antipode

Re: Thread for your script-related questions

Post by PkmnQ » March 29th, 2021, 8:32 am

dvgrn wrote:
March 29th, 2021, 8:30 am
PkmnQ wrote:
March 29th, 2021, 8:22 am
I can't even load in a loafer.
Why not, exactly? Please try being more specific in bug reports -- it seems silly to have to go through several cycles of posts to painfully extract the relevant information from people.

I saved the script to Golly's Scripts/Python directory, entered "xq7_3nw17862z6952", and ended up with a downward-traveling loafer, as expected.
Wait, sorry. I accidentally pasted it into a filename which might've removed some important characters.
Edit: I pasted it in properly this time and it works. Sorry for the confusion.
Random posts isn't the problem, toxicity is. Don't be toxic.

Anyway, I created a CA which has a lot of infinte growths.

User avatar
GUYTU6J
Posts: 1374
Joined: August 5th, 2016, 10:27 am
Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
Contact:

Re: Thread for your script-related questions

Post by GUYTU6J » April 1st, 2021, 5:29 am

Is lifelib capable of analyzing methuselahs, i.e. given a pattern RLE, can any function output its lifespan, bounding box, MCPS, final population, etc?
Lifequote:
In the drama The Peony Pavilion, Tang Xianzu wrote: 原来姹紫嫣红开遍,似这般都付与断井颓垣。
(Here multiflorate splendour blooms forlorn
Midst broken fountains, mouldering walls.)
I'm afraid there's arrival but no departure.
Stop Japan from dumping nuclear waste!

User avatar
cgoler2
Posts: 147
Joined: March 10th, 2021, 2:32 pm

Re: Thread for your script-related questions

Post by cgoler2 » April 7th, 2021, 4:27 pm

Where is searchRule-matchPatt2.lua?

User avatar
GUYTU6J
Posts: 1374
Joined: August 5th, 2016, 10:27 am
Location: 拆哪!I repeat, CHINA! (a.k.a. 种花家)
Contact:

A Java question not related to CA (sorry)

Post by GUYTU6J » April 10th, 2021, 1:56 am

How do I compile and run the Java QuasiTiler from https://sourceforge.net/projects/quasitiler/? I have installed Java —

Code: Select all

java version "1.8.0_281"
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)
Java HotSpot(TM) Client VM (build 25.281-b09, mixed mode, sharing)
— but my command prompt doesn't recognize "javac".
Lifequote:
In the drama The Peony Pavilion, Tang Xianzu wrote: 原来姹紫嫣红开遍,似这般都付与断井颓垣。
(Here multiflorate splendour blooms forlorn
Midst broken fountains, mouldering walls.)
I'm afraid there's arrival but no departure.
Stop Japan from dumping nuclear waste!

User avatar
yujh
Posts: 2173
Joined: February 27th, 2020, 11:23 pm
Location: 我不觉得我迷路了,但是我不知道我在哪里
Contact:

Re: Thread for your script-related questions

Post by yujh » April 19th, 2021, 8:10 am

How to make viewers on other websites (html5?)

User avatar
dvgrn
Moderator
Posts: 7863
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Thread for your script-related questions

Post by dvgrn » April 19th, 2021, 8:37 am

yujh wrote:
April 19th, 2021, 8:10 am
How to make viewers on other websites (html5?)
Meaning, you want to set up LifeViewer to work outside of the context of the forums or LifeWiki?

Here are some sample HTML files that do basically that. You can run those pages offline, at the expense of probably using an older version of LifeViewer. (I haven't bothered to update the checked-in version of lv-plugin.js past Build 521, whereas the current version is something like 597.)

Instead of the line '<script src="lv-plugin.js"></script>', you could point the browser to some other location, like

Code: Select all

<script src="https://www.conwaylife.com/forums/styles/prosilver/template/lv-plugin.js"></script>
If you do that, then you'll always be working with the latest version of LifeViewer -- as long as conwaylife.com isn't down and you have a working Internet connection.

Otherwise, you just need to follow the exact HTML structure given in the samples, and LifeViewer will see it and use it:

Code: Select all

<div class="viewer">
	<a href="" onclick="updateViewer(this); return false;">View Standalone</a><br>
	<textarea rows=4 cols=75>
#C put RLE here
#C [[ "with LifeViewer waypoint script commands" ]] if you want them
x = 3, y = 3, rule = B3/S23
3o$o$bo!
	</textarea>
	<br>
	<canvas width="1024" height="512"></canvas>
</div>
Canvas size, textarea height, link text, etc., can be adjusted as needed. LifeViewer is mainly looking for the div with a class of "viewer", and inside that, a textarea containing the RLE, and a canvas.

There's probably something subtle I've forgotten about the "View Standalone" link at the top, but maybe someone else can explain that.

User avatar
bibunsekibun
Posts: 62
Joined: April 17th, 2021, 7:58 pm
Location: TRAPPIST-1e

Re: Thread for your script-related questions

Post by bibunsekibun » April 20th, 2021, 4:19 am

Is there an Isotropic Non-totalistic Spaceship search script that can be run without C++?
I'm sleepy
I'm not good at English, so please let me know if you have any grammatical mistakes
My Favorite Pattern is 60P312

Schiaparelliorbust
Posts: 3669
Joined: July 22nd, 2020, 9:50 am
Location: Acidalia Planitia

Re: Thread for your script-related questions

Post by Schiaparelliorbust » April 20th, 2021, 4:34 am

bibunsekibun wrote:
April 20th, 2021, 4:19 am
Is there an Isotropic Non-totalistic Spaceship search script that can be run without C++?
Yes, try rlifesrc.
Hunting's language (though he doesn't want me to call it that)
Board And Card Games
Colorised CA
Alien Biosphere

User avatar
bibunsekibun
Posts: 62
Joined: April 17th, 2021, 7:58 pm
Location: TRAPPIST-1e

Re: Thread for your script-related questions

Post by bibunsekibun » April 20th, 2021, 5:31 am

Schiaparelliorbust wrote:
April 20th, 2021, 4:34 am
bibunsekibun wrote:
April 20th, 2021, 4:19 am
Is there an Isotropic Non-totalistic Spaceship search script that can be run without C++?
Yes, try rlifesrc.
Wow, Thank you so much!
I'm sleepy
I'm not good at English, so please let me know if you have any grammatical mistakes
My Favorite Pattern is 60P312

User avatar
yujh
Posts: 2173
Joined: February 27th, 2020, 11:23 pm
Location: 我不觉得我迷路了,但是我不知道我在哪里
Contact:

Re: Thread for your script-related questions

Post by yujh » April 20th, 2021, 5:42 am

What about a rule generator for alternating rules? Like viewtopic.php?f=11&t=719&start=75#p72993 but generate the rule table but not only running a pattern.

User avatar
LaundryPizza03
Posts: 1278
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: Thread for your script-related questions

Post by LaundryPizza03 » April 26th, 2021, 12:21 pm

Why do the parameters B34/S1567/o3n1v/l108 in gfind mysteriously get stuck so quickly?

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia

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!

Sokwe
Moderator
Posts: 1849
Joined: July 9th, 2009, 2:44 pm

Re: Thread for your script-related questions

Post by Sokwe » April 26th, 2021, 11:28 pm

LaundryPizza03 wrote:
April 26th, 2021, 12:21 pm
Why do the parameters B34/S1567/o3n1v/l108 in gfind mysteriously get stuck so quickly?
It does seem to be getting stuck at depth 73 and can't complete the depth-first step. I also tried giving it a large queue size and it still appears to get stuck in the breadth-first step.

Interestingly, I ran it with Paul Tooke's modified gfind (compiled with PATCH04 commented out to allow for searches above logical width 14) and it finds a ship at depth 73:

Code: Select all

x = 36, y = 22, rule = B34/S1567
6bobo18bobo$6bobo2bo12bo2bobo$4b2o7b2o6b2o7b2o$5bobo2bob2obo4bob2obo2b
obo$4bo3bobo3bo6bo3bobo3bo$4b2o5bo2bo6bo2bo5b2o$7b4o6b2o6b4o$3bo2bo4b
2o10b2o4bo2bo$3bob2o5b2o3b2o3b2o5b2obo$2bobo4b3o3b6o3b3o4bobo$b5o2bo3b
3o6b3o3bo2b5o$5bobo2bo4b6o4bo2bobo$b4ob3ob2obo8bob2ob3ob4o$5bo4b4obo4b
ob4o4bo$5bo3b3obobo4bobob3o3bo$2o3b3o2bobo2b6o2bobo2b3o3b2o$3bob2o2bob
obo3b2o3bobobo2b2obo$2bo3b4o2b5o2b5o2b4o3bo$4bo2b9o4b9o2bo$11b3obo4bob
3o$13bobob2obobo$15bo4bo!
It then completes the depth-first step normally. Without actually looking at any code, I would guess the problem is in success(), which should print a complete spaceship detected by terminal() (one could check if it gets stuck after terminal() returns true). Perhaps an older version of gfind will work (such as v4.6, on which Paul's modification is based). Then one could look at the changes between versions to get an idea of what's causing the problem.
-Matthias Merzenich

User avatar
LaundryPizza03
Posts: 1278
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: Thread for your script-related questions

Post by LaundryPizza03 » April 28th, 2021, 10:57 am

Sokwe wrote:
April 26th, 2021, 11:28 pm
LaundryPizza03 wrote:
April 26th, 2021, 12:21 pm
Why do the parameters B34/S1567/o3n1v/l108 in gfind mysteriously get stuck so quickly?
It does seem to be getting stuck at depth 73 and can't complete the depth-first step. I also tried giving it a large queue size and it still appears to get stuck in the breadth-first step.

Interestingly, I ran it with Paul Tooke's modified gfind (compiled with PATCH04 commented out to allow for searches above logical width 14) and it finds a ship at depth 73:

Code: Select all

x = 36, y = 22, rule = B34/S1567
6bobo18bobo$6bobo2bo12bo2bobo$4b2o7b2o6b2o7b2o$5bobo2bob2obo4bob2obo2b
obo$4bo3bobo3bo6bo3bobo3bo$4b2o5bo2bo6bo2bo5b2o$7b4o6b2o6b4o$3bo2bo4b
2o10b2o4bo2bo$3bob2o5b2o3b2o3b2o5b2obo$2bobo4b3o3b6o3b3o4bobo$b5o2bo3b
3o6b3o3bo2b5o$5bobo2bo4b6o4bo2bobo$b4ob3ob2obo8bob2ob3ob4o$5bo4b4obo4b
ob4o4bo$5bo3b3obobo4bobob3o3bo$2o3b3o2bobo2b6o2bobo2b3o3b2o$3bob2o2bob
obo3b2o3bobobo2b2obo$2bo3b4o2b5o2b5o2b4o3bo$4bo2b9o4b9o2bo$11b3obo4bob
3o$13bobob2obobo$15bo4bo!
It then completes the depth-first step normally. Without actually looking at any code, I would guess the problem is in success(), which should print a complete spaceship detected by terminal() (one could check if it gets stuck after terminal() returns true). Perhaps an older version of gfind will work (such as v4.6, on which Paul's modification is based). Then one could look at the changes between versions to get an idea of what's causing the problem.
I can't compile those now, so you try: B35/S16/o3n1u/l108.

EDIT: Found using ikpx2. The search in this rule is very memory-intensive for some reason.

Code: Select all

x = 33, y = 36, rule = B35/S16
9bo3b3ob3o3bo$7bo2bob2o5b2obo2bo$7bobobo4bo4bobobo$5bo4b3o7b3o4bo$8bo2bo3bobo
3bo2bo$2bob2o3bob2o3bo3b2obo3b2obo$bo4b2o17b2o4bo$ob4ob3o4bo3bo4b3ob4obo$4bo
5bobo7bobo5bo$b2o2bo2bo4bob3obo4bo2bo2b2o$14bo3bo$4bobo5bo7bo5bobo$b2obobo3bo
11bo3bobob2o$3bo4bobo4bobo4bobo4bo$bo9b2o2bobo2b2o9bo$2o8bob2o2bo2b2obo8b2o$b
o3b3obo13bob3o3bo$o2bobo4bo4bobo4bo4bobo2bo$6bobo7bo7bobo$b3obob3ob2o7b2ob3ob
ob3o$7bob4o7b4obo$9bob2o7b2obo2$7bobo2b2o5b2o2bobo$12bo7bo$11b2ob2ob2ob2o$10b
2o9b2o$9b3o2bo3bo2b3o$8b3o3bo3bo3b3o$8b3o2bo5bo2b3o$8bobo3bo3bo3bobo$6b3ob2o
2bobobo2b2ob3o$9bo2bo2bobo2bo2bo2$11bo2b2ob2o2bo$12bo7bo!

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia

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!

User avatar
cgoler2
Posts: 147
Joined: March 10th, 2021, 2:32 pm

Re: Thread for your script-related questions

Post by cgoler2 » May 7th, 2021, 9:36 pm

Is there a Lua script that converts

Code: Select all

x =3, y =3, rule =B3/S23
bo$2bo$3o!
into

Code: Select all

x =3, y =3, rule =B3/S23
bob$
bbo$
ooo$
?

User avatar
dvgrn
Moderator
Posts: 7863
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Thread for your script-related questions

Post by dvgrn » May 7th, 2021, 10:28 pm

cgoler2 wrote:
May 7th, 2021, 9:36 pm
Is there a Lua script that converts

Code: Select all

x =3, y =3, rule =B3/S23
bo$2bo$3o!
into

Code: Select all

x =3, y =3, rule =B3/S23
bob$
bbo$
ooo$
?
I don't know of one. But I discovered recently that I had forgotten all the Golly-related Lua that I used to know, so apparently I need some practice.

I checked in this script for you -- pat-to-ascii.lua:

Code: Select all

-- pat-to-ascii.lua
-- select a pattern in Golly, run this script,
--   and a plaintext ASCII format version of
--   the pattern will be copied to the clipboard
--
-- For a variant producing Life Lexicon format, see also
--   http://conwaylife.com/forums/viewtopic.php?p=64427#p64427

local g = golly()
r = g.getselrect()
s=""
for y = 0, r[4] do
  for x = 0, r[3] do
    if g.getcell(x+r[1], y + r[2]) == 1 then
      s = s.."*"
    else
      s = s.."."
    end
  end
  s = s.."\n"
end

g.setclipstr(s)
Changes to the above to make it produce the RLE format that you're asking for, are absolutely completely trivial, to the point where anyone can do it even if they don't know anything about programming. It currently works on a selection in Golly and writes the output to the clipboard -- so it would take just a little bit more fiddling to start with a standard RLE pattern in the clipboard and end with a Catagolue-style RLE pattern in the clipboard.

If you can't see how, just ask more script-related questions here until you can see how.

Post Reply