Thread for your script-related questions

For scripts to aid with computation or simulation in cellular automata.
carsoncheng
Posts: 475
Joined: June 11th, 2022, 11:24 pm

Re: Thread for your script-related questions

Post by carsoncheng » September 2nd, 2022, 1:08 am

GUYTU6J wrote:
August 20th, 2022, 12:22 pm
Only the first result is correct, and the rest is for a different R+loaf collision. Their population sequence diverts at generation 18:

Code: Select all

x = 42, y = 16, rule = B3/S23
5b3o26b3o$4bo2bo25bo2bo$4b2o3bo23b2o3bo$7b3o26b3o$8bo28bo2$10bo28bo$4b
ob6o21bob6o$3bo8bo19bo8bo$4bo6bo21bo6bo$11bo28bo$8bobo26bobo$2bo28bo$b
obo26bobo$o2bo26bo2bo$b2o28b2o!
#C [[ STOP 18 ]]
So, how late should I choose the target pattern to avoid the false positive results?
Well, that explains the issue. As far as I know, popseq only checks for population matches for up to 16 generations, so any difference after that point is not being recorded. Therefore, if you're getting an unmanageable amount of false positives, advance your pattern by a few generations and try again.

User avatar
C28
Posts: 728
Joined: December 8th, 2020, 12:23 pm
Location: WORLD -1

Re: Thread for your script-related questions

Post by C28 » December 13th, 2022, 8:04 pm

how does bellman find catalysts? like if i wanted to find a replacement catalyst for the block in this pattern:

Code: Select all

x = 12, y = 4, rule = B3/S23
9b3o$9b3o$2o6bobo$2o6b2o!
how would bellman go about finding one?
- Christopher D'Agostino

adopted father of the U-turner

Code: Select all

x = 11, y = 15, rule = B3/S23
9bo$8bobo$8bobo$9bo8$b3o$b3o$obo$2o!
the U-turner gallery
255P132
B3/S234z (Zlife)

User avatar
squareroot12621
Posts: 628
Joined: March 23rd, 2022, 4:53 pm

Re: Thread for your script-related questions

Post by squareroot12621 » December 15th, 2022, 4:34 pm

Is there already an RLE→Plaintext converter? If not, I've made one:

Code: Select all

# RLE to Plaintext converter.
rle = input("Input a two-state RLE here.")

useful = [i for i in "".join([j for j in rle.replace("\r", "").split("\n") if j.replace(" ", "").replace("\t", "")[0] not in ["#", "x"]]).replace("o", " O ").replace("b", " . ").replace("$", " $ ").replace("!", "").replace("  ", " ").split(" ") if i != ""]
                              # Split RLE into lines______________________ # Remove lines starting with "#" or "x"_____________________  # Put whitespace around different "groups" and turn it into a Pseudo-Plaintext format in a list____________ # Remove empty characters

for k in range(len(useful)):
 if len(useful[k].replace("O", ".").replace("$", ".").split(".")) == 1:
  useful[k] = int(useful[k]) # Turn string-type numbers into integer-type numbers

plaintext_oneline = ""
for l in range(len(useful)):
 if str(type(useful[l])) == "<class 'str'>":
  if str(type(useful[max([l-1,0])])) == "<class 'str'>":
   plaintext_oneline += useful[l]
  else:
   plaintext_oneline += useful[l-1] * useful[l]
plaintext_multiline = plaintext_oneline.split("$")
# Turning <number><character> into <character>, repeated <number> times

plaintext_length = len(max(plaintext_multiline))
for m in range(len(plaintext_multiline)):
 plaintext_multiline[m] = plaintext_multiline[m] + (plaintext_length - len(plaintext_multiline[m]) + 1) * "."
# Adding .'s at the end of each line to make them the same length

plaintext = "\n".join(plaintext_multiline)
# Finally, joining the array together to create Plaintext format

print(plaintext)

Code: Select all

4b8o$4b8o$4b8o$4b8o$4o8b4o$4o8b4o$4o8b4o$4o8b4o$4o8b4o$4o8b4o$4o8b4o$4o8b4o$4b8o$4b8o$4b8o$4b8o![[ THEME 0 AUTOSTART GPS 8 Z 16 T 1 T 1 Z 19.027 T 2 T 2 Z 22.627 T 3 T 3 Z 26.909 T 4 T 4 Z 32 T 5 T 5 Z 38.055 T 6 T 6 Z 45.255 T 7 T 7 Z 53.817 LOOP 8 ]]

Book
Posts: 385
Joined: August 28th, 2021, 2:38 pm
Location: California
Contact:

Re: Thread for your script-related questions

Post by Book » December 15th, 2022, 5:08 pm

Phil Bookman

User avatar
bibunsekibun
Posts: 345
Joined: April 17th, 2021, 7:58 pm
Location: Japan

Re: Thread for your script-related questions

Post by bibunsekibun » December 17th, 2022, 10:35 pm

Does a script exist to discover the parent of a given pattern?
sorry I can only speak Japanese, English is made by machine translation
I'm a fan of methuselahs

Book
Posts: 385
Joined: August 28th, 2021, 2:38 pm
Location: California
Contact:

Re: Thread for your script-related questions

Post by Book » December 18th, 2022, 1:47 pm

bibunsekibun wrote:
December 17th, 2022, 10:35 pm
Does a script exist to discover the parent of a given pattern?
A pattern can have many parents. Some, infinitely many.
Phil Bookman

User avatar
silversmith
Posts: 329
Joined: June 15th, 2020, 6:20 pm
Location: Pennsylvania, USA, Earth, Sector 5ff63D6
Contact:

Re: Thread for your script-related questions

Post by silversmith » December 18th, 2022, 2:26 pm

bibunsekibun wrote:
December 17th, 2022, 10:35 pm
Does a script exist to discover the parent of a given pattern?
Logic Life Search is a program which can do that, although it is not a simple golly script.
A simulator with the tools I couldn’t find elsewhere: https://www.silversimulations.com/caplayer/
Documentation:https://github.com/teraxtech/caplayer

User avatar
bibunsekibun
Posts: 345
Joined: April 17th, 2021, 7:58 pm
Location: Japan

Re: Thread for your script-related questions

Post by bibunsekibun » January 3rd, 2023, 8:41 pm

I downloaded synthesis-patt, but it doesn't finish "Decompressing rles.txt.bz2...". How do I fix this?
sorry I can only speak Japanese, English is made by machine translation
I'm a fan of methuselahs

shuich01
Posts: 36
Joined: March 27th, 2021, 8:40 pm
Location: PRC

Re: Thread for your script-related questions

Post by shuich01 » January 25th, 2023, 8:57 am

Does an algorithm that can detect a spaceship's exitance in certain width instead of "really" searching for spaceships exist?
Still wandering ...

User avatar
pzq_alex
Posts: 793
Joined: May 1st, 2021, 9:00 pm
Location: tell me if you know

Re: Thread for your script-related questions

Post by pzq_alex » January 26th, 2023, 8:45 am

shuich01 wrote:
January 25th, 2023, 8:57 am
Does an algorithm that can detect a spaceship's exitance in certain width instead of "really" searching for spaceships exist?
tl;dr: no.

Most spaceship search algorithms represents the actual spaceship as a path in a certain graph and preforms a search on that graph. It's hard to say there isn't a path on the graph until you've seen everything that's reachable from the starting point!
\sum_{n=1}^\infty H_n/n^2 = \zeta(3)

How much of current CA technology can I redevelop "on a desert island"?

User avatar
LaundryPizza03
Posts: 2323
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 » February 11th, 2023, 4:17 am

Is it possible to import an external module such as NumPy into a Golly script?

Code: Select all

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

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

Re: Thread for your script-related questions

Post by dvgrn » February 11th, 2023, 10:34 am

LaundryPizza03 wrote:
February 11th, 2023, 4:17 am
Is it possible to import an external module such as NumPy into a Golly script?
Sure -- just have to install whatever you want, probably with "pip install".

Install into the copy of Python that Golly is actually pointed to. Given all the horrible user-directory locations that different copies of Python can be installed to these days, pulling up the right command prompt to run "pip install" can sometimes be the tricky part.

User avatar
LaundryPizza03
Posts: 2323
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 » February 12th, 2023, 2:18 pm

dvgrn wrote:
February 11th, 2023, 10:34 am
LaundryPizza03 wrote:
February 11th, 2023, 4:17 am
Is it possible to import an external module such as NumPy into a Golly script?
Sure -- just have to install whatever you want, probably with "pip install".

Install into the copy of Python that Golly is actually pointed to. Given all the horrible user-directory locations that different copies of Python can be installed to these days, pulling up the right command prompt to run "pip install" can sometimes be the tricky part.
How do I determine which Python directory is used by Golly on my system?

Code: Select all

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

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

Re: Thread for your script-related questions

Post by dvgrn » February 12th, 2023, 11:10 pm

LaundryPizza03 wrote:
February 12th, 2023, 2:18 pm
How do I determine which Python directory is used by Golly on my system?
Is this on Windows? The general idea is to check GollyPrefs for a line that looks like

Code: Select all

python3_lib=python39.dll
If that line has a full path, C:\blah\blah\blah\python39.dll, then that's the version you're looking for.

If it just says "python39.dll" as above, then Golly is relying on the Python DLL's location being included in the system PATH variable. Search in Start bar for "Advanced system settings", click on "Environment variables", look under "System variables" for PATH. On my system it looks like this, just as an example:
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\PowerShell7\7\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Oracle\EPM Automate\bin;C:\Python39\Scripts;C:\Python39;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Program Files (x86)\dotnet-core-uninstall\

User avatar
LaundryPizza03
Posts: 2323
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 » February 13th, 2023, 2:38 am

dvgrn wrote:
February 12th, 2023, 11:10 pm
LaundryPizza03 wrote:
February 12th, 2023, 2:18 pm
How do I determine which Python directory is used by Golly on my system?
Is this on Windows? The general idea is to check GollyPrefs for a line that looks like

Code: Select all

python3_lib=python39.dll
If that line has a full path, C:\blah\blah\blah\python39.dll, then that's the version you're looking for.

If it just says "python39.dll" as above, then Golly is relying on the Python DLL's location being included in the system PATH variable. Search in Start bar for "Advanced system settings", click on "Environment variables", look under "System variables" for PATH. On my system it looks like this, just as an example:
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\PowerShell7\7\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Oracle\EPM Automate\bin;C:\Python39\Scripts;C:\Python39;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Program Files (x86)\dotnet-core-uninstall\
No, I am using the macOS version. 12.5.1, to be specific.

Code: Select all

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

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

Re: Thread for your script-related questions

Post by dvgrn » February 13th, 2023, 10:11 am

LaundryPizza03 wrote:
February 13th, 2023, 2:38 am
No, I am using the macOS version. 12.5.1, to be specific.
Got it. Hopefully somebody with a Mac can give you Mac-specific details -- I'd probably only lead you astray, since I only have available the same Google search results that you do.

However, the first part about looking for the "python3_lib=" line in your GollyPrefs is equally true for any platform. Now, the GollyPrefs can be in a couple different locations, one location overriding the other. By default it's in Golly's data directory, which on a Mac should be

~/Library/Application Support/Golly/

but if you put a copy of the GollyPrefs file in the same folder as Golly.app, then it won't look in the ~/Library location. This is a potentially confusing feature that makes perfect sense if you always follow the exact recommended instructions for doing an upgrade to a new version of Golly, automatically keeping your old favorite settings from the previous version -- but nobody (myself included) ever does seem to follow those instructions.

AlbertArmStain
Posts: 1253
Joined: January 28th, 2022, 7:18 pm
Location: Planet Z

Re: Thread for your script-related questions

Post by AlbertArmStain » March 9th, 2023, 6:10 pm

Is there a script for finding 2c/4 flyby reactions?

User avatar
PHPBB12345
Posts: 1096
Joined: August 5th, 2015, 11:55 pm
Contact:

Re: Thread for your script-related questions

Post by PHPBB12345 » April 7th, 2023, 11:45 pm

How to convert Golly's Lua script from/to Glu's Lua script?

Haycat2009
Posts: 765
Joined: April 26th, 2023, 5:47 am
Location: Bahar Junction, Zumaland

Re: Thread for your script-related questions

Post by Haycat2009 » August 31st, 2023, 2:19 am

What are the list of bespoke constructions in Slmake?
~ Haycat Durnak, a hard-working editor
Also, support Conway and Friends story mode!
I mean no harm to those who have tested me. But do not take this for granted.

User avatar
confocaloid
Posts: 2933
Joined: February 8th, 2022, 3:15 pm

Re: Thread for your script-related questions

Post by confocaloid » August 31st, 2023, 2:45 am

Haycat2009 wrote:
August 31st, 2023, 2:19 am
What are the list of bespoke constructions in Slmake?
I think it is here: https://gitlab.com/apgoucher/slmake/-/t ... type=heads
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.

User avatar
MEisSCAMMER
Posts: 96
Joined: September 20th, 2022, 5:12 pm
Location: Yes
Contact:

Re: Thread for your script-related questions

Post by MEisSCAMMER » September 2nd, 2023, 3:22 pm

I'm trying to configure apgluxe so that it automatically calls it with my payosha256 key, which I keep forgetting to add manually. How do I go about this?

edit: solved (on mac) by staring at the recompile script a lot and finding a useful-looking command, then creating "apgsearch.sh":

Code: Select all

./apgluxe -k [key] "$@"
Last edited by MEisSCAMMER on September 5th, 2023, 8:11 pm, edited 1 time in total.
THE TRILOGY HAS BEEN COMPLETED
next: quadrilogy??? Is that even a word

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

Re: Thread for your script-related questions

Post by dvgrn » September 2nd, 2023, 6:54 pm

MEisSCAMMER wrote:
September 2nd, 2023, 3:22 pm
I'm trying to configure apgluxe so that it automatically calls it with my payosha256 key, which I keep forgetting to add manually. How do I go about this?
Put your preferred call into a batch file, maybe, then always initiate apgsearch via the batch file?

DaveTree339
Posts: 5
Joined: December 22nd, 2021, 7:47 pm

Re: Thread for your script-related questions

Post by DaveTree339 » October 19th, 2023, 8:36 pm

How does one get "import golly as g" to work in python?
I have golly 4.2 64 bit and python 3.11.0 64 installed and the golly scripts like pop-plot work just fine but this is what happens when I put in "import golly as g" in python:
>>> import golly as g
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'golly'
>>>

I tried to find answers just by searching the forums and discord but I didn't find any so I'm clueless as to how to proceed with importing the golly module since the function that's supposed to do it isn't working for a reason I can't figure out.

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

Re: Thread for your script-related questions

Post by dvgrn » October 19th, 2023, 9:50 pm

DaveTree339 wrote:
October 19th, 2023, 8:36 pm
How does one get "import golly as g" to work in python?
The "import golly as g" line only works for Python scripts run from Golly (while Golly is open). Otherwise the relevant pieces of Golly functionality won't be available.

DaveTree339
Posts: 5
Joined: December 22nd, 2021, 7:47 pm

Re: Thread for your script-related questions

Post by DaveTree339 » October 19th, 2023, 10:13 pm

Ok, I do not understand what you mean. I'm trying to follow this tutorial:
https://conwaylife.com/wiki/Tutorials/Y ... hon_script

Are you saying I have to somehow write the script in golly so that the script runs from golly?
The tutorial mentions a python ide window but doesn't elaborate on what it is, I assumed it was just the python window if that's the right name for it.

Post Reply