Scripts for building burning helices

For scripts to aid with computation or simulation in cellular automata.
Post Reply
User avatar
codeholic
Moderator
Posts: 1147
Joined: September 13th, 2011, 8:23 am
Location: Hamburg, Germany

Scripts for building burning helices

Post by codeholic » December 23rd, 2013, 1:45 pm

Here are scripts I wrote for building burning helices:

https://github.com/codeholic/helix

They automate a lot, but not everything. One should glue helix loops together manually.

My acknowledgements go to oblique for his script, that was used to build a database of collisions.
Ivan Fomichev

HartmutHolzwart
Posts: 840
Joined: June 27th, 2009, 10:58 am
Location: Germany

Re: Scripts for building burning helices

Post by HartmutHolzwart » January 18th, 2014, 6:21 pm

I have installed strawberry, but can't start the helix script. Perl scripts from Golly do work, but I can't manage to make perl find the directory where I stored the helix.pl script. Any tips?

Thanks in advance!

Hartmut

User avatar
codeholic
Moderator
Posts: 1147
Joined: September 13th, 2011, 8:23 am
Location: Hamburg, Germany

Re: Scripts for building burning helices

Post by codeholic » January 18th, 2014, 7:26 pm

helix.pl runs without golly, you can run it from anywhere:

Code: Select all

X:\path\to\perl helix.pl [dt] [dx] [dy]
You may want to tune these constants in the script:

Code: Select all

my $NO_STRAIGHTS = 1;
my $MAX_FACTOR = 30;
my $MAX_LENGTH = 2;
NO_STRAIGHTS means that it doesn't search for reactions where the glider doesn't change its direction. MAX_FACTOR limits the factor of the helix compared to the given period. MAX_LENGTH is the max number of interactions.

If you're looking for a helix for the caterpillar, you definitely need to set NO_STRAIGHTS to 0, MAX_FACTOR to 6 and MAX_LENGTH to something about 21 (that's the period factor and the length of the original caterpillar's helix, if I remember correctly).
Ivan Fomichev

User avatar
codeholic
Moderator
Posts: 1147
Joined: September 13th, 2011, 8:23 am
Location: Hamburg, Germany

Re: Scripts for building burning helices

Post by codeholic » January 18th, 2014, 7:29 pm

Oh, yeah, one more thing. If you want more variation, you might want to change how helix uniqueness is determined:

Code: Select all

diff --git a/helix.pl b/helix.pl
index a3691d0..91e96ac 100755
--- a/helix.pl
+++ b/helix.pl
@@ -36,8 +36,7 @@ foreach my $n (1..$MAX_FACTOR) {
 sub g {
   my ($c) = @_;
   return ($c->{dx} > 0 ? '>' : '<')
-    . join('-', @$c{'t', 'x', 'y'})
-    . ($c->{f} ? '!' : '');
+    . $c->{id};
 }
 
 sub bt {
Ivan Fomichev

HartmutHolzwart
Posts: 840
Joined: June 27th, 2009, 10:58 am
Location: Germany

Re: Scripts for building burning helices

Post by HartmutHolzwart » January 20th, 2014, 4:58 pm

What would happen if I try
helix 90 0 -34
?

build-helix still doesn't work for me! Some error with standard perl libs (perl/lib/test), although other Golly test scripts do run.

Rgds,
Hartmut

User avatar
codeholic
Moderator
Posts: 1147
Joined: September 13th, 2011, 8:23 am
Location: Hamburg, Germany

Re: Scripts for building burning helices

Post by codeholic » January 21st, 2014, 6:19 pm

I adjusted settings a little bit:

Code: Select all

diff --git a/helix.pl b/helix.pl
index a3691d0..12f733d 100755
--- a/helix.pl
+++ b/helix.pl
@@ -13,9 +13,9 @@ memoize('get_turns');
 my ($dsn, $user, $password) = ("dbi:SQLite:dbname=$FindBin::Bin/helix.sqlite3", '', '');
 my $dbh = DBI->connect($dsn, $user, $password);
 
-my $NO_STRAIGHTS = 1;
-my $MAX_FACTOR   = 30;
-my $MAX_LENGTH   = 2;
+my $NO_STRAIGHTS = 0;
+my $MAX_FACTOR   = 10;
+my $MAX_LENGTH   = 10;
 
 my $FUZZINESS_STRAIGHTS = 4;
 my $FUZZINESS_TURNS     = 0;
@@ -36,8 +36,7 @@ foreach my $n (1..$MAX_FACTOR) {
 sub g {
   my ($c) = @_;
   return ($c->{dx} > 0 ? '>' : '<')
-    . join('-', @$c{'t', 'x', 'y'})
-    . ($c->{f} ? '!' : '');
+    . $c->{id};
 }
 
 sub bt {
Then I ran helix.pl:

Code: Select all

./helix.pl 90 0 -34
and got:

Code: Select all

n=1
n=2
n=3
2527:2527:2527:2527:410:2527:2527:2527:2527:410
2527:2527:2527:2527:703:2527:2527:2527:146:1738
2527:2527:2527:2527:703:2527:2527:2527:146:1749
2527:2527:2527:2527:703:2527:2527:2527:4152
2527:2527:2527:2527:1408:2527:2527:2527:146:3890
2527:2527:2527:2527:1413:2527:2527:2527:146:3890
2527:2527:2527:2527:1419:2527:2527:2527:146:3890
2527:2527:2527:2527:1749:2527:2527:2527:2527:5153
2527:2527:2527:2527:1888:2527:2527:2527:2527:3165
2527:2527:2527:2527:1888:2527:2527:2527:2527:3929
2527:2527:2527:2527:2052:2527:2527:2527:2527:5012
2527:2527:2527:2527:2778:2527:2527:2527:2527:5883
2527:2527:2527:2527:3439:2527:2527:2527:2527:4882
2527:2527:2527:2527:3723:2527:2527:2527:2527:2948
2527:2527:2527:2527:3929:2527:2527:2527:3890
2527:2527:2527:2527:4882:2527:2527:2527:2527:3439
2527:2527:2527:2527:5012:2527:2527:2527:2527:5012
2527:2527:2527:2527:5153:2527:2527:2527:2527:1749
2527:2527:2527:2527:5155:2527:2527:2527:2527:2948
2527:2527:2527:2527:5193:2527:2527:2527:2527:2343
2527:2527:2527:3051:1052:2527:2527:2527:2527:4351
2527:2527:2527:3051:2343:2527:2527:2527:146:3165
2527:2527:2527:3051:2343:2527:2527:2527:3890
2527:2527:2527:3051:3165:2527:2527:2527:146:2343
2527:2527:2527:3051:3165:2527:2527:2527:3051:3165
2527:2527:2527:75:2527:2527:2527:2527:248
2527:2527:2527:75:2527:2527:2527:3165
2527:2527:2527:75:2527:2527:2527:4907
2527:2527:2527:75:2527:2527:2527:4932
2527:2527:2527:1624:2527:2527:3051:3051:146:703
2527:2527:2527:2343:2527:2527:2527:3890:1076
2527:2527:2527:2343:2527:2527:2527:3890:1134
2527:2527:2527:2343:2527:2527:2527:3890:1185
2527:2527:2527:2804:2527:2527:2527:5662:703
2527:2527:2527:3036:2527:2527:2527:2527:2056
2527:2527:2527:3890:2527:2527:1076:2527:2343
2527:2527:2527:3890:2527:2527:1134:2527:2343
2527:2527:2527:3890:2527:2527:1185:2527:2343
2527:2527:2527:3890:2527:2527:2527:2527:3929
2527:2527:2527:3890:2527:2527:2527:3051:2343
2527:2527:2527:4134:2527:2527:2527:2527:703
2527:2527:2527:4152:2527:2527:2527:2527:703
2527:2527:2527:4173:2527:2527:2527:2527:703
2527:2527:2527:5681:2527:2527:2527:2527:3165
2527:2527:3051:75:2527:2527:2527:2343
2527:2527:75:2527:2527:2527:2343:1076
2527:2527:75:2527:2527:2527:2343:1134
2527:2527:75:2527:2527:2527:2343:1185
n=4
^C
(I stopped the search with Ctrl+C once I had got enough.)

Then I ran build-helix.pl in Golly and tried helices with the least length, and I found out that 2527:2527:2527:75:2527:2527:2527:3165 fits the best.

After some copy-pasting, I've got the following helix backbone (one would just need to run some gencols searches in order to get rid of debris destroying it and get one or two output gliders instead):

Code: Select all

x = 70, y = 69, rule = B3/S23
21bo$20b3o12bo$20bob2o3b3o4b3o12bo$15b2o4b3o3bo2bo3bob2o3b3o4b3o$14bob
o4b2o4bo7b3o3bo2bo3bob2o3b3o7b3o$16bo10bo3bo3b2o4bo7b3o3bo2bo5bo2bo$
27bo3bo9bo3bo3b2o4bo11bo$27bo13bo3bo9bo3bo3bo3bo$28bobo10bo13bo3bo3bo
3bo$42bobo10bo11bo$56bobo5bobo5$60bo$49bo9b3o$35bo12b3o8bob2o$21bo12b
3o4b3o3b2obo9b3o$20b3o4b3o3b2obo3bo2bo3b3o10b3o$13b3o3b2obo3bo2bo3b3o
7bo4b2o10b3o$12bo2bo3b3o7bo4b2o3bo3bo16b2o$15bo4b2o3bo3bo9bo3bo$11bo3b
o9bo3bo13bo$11bo3bo13bo10bobo$15bo10bobo$12bobo4$b3o$o2bo6b3o$3bo5bo2b
o$3bo8bo8bo$obo9bo7b3o12bo$9bobo7b2obo4b3o4b3o12bo$19b3o4bo2bo3b2obo4b
3o4b3o$20b2o7bo3b3o4bo2bo3b2obo4b3o7b3o$25bo3bo4b2o7bo3b3o4bo2bo7bo2bo
$25bo3bo9bo3bo4b2o7bo7bo$29bo9bo3bo9bo3bo7bo3bo$26bobo14bo9bo3bo7bo3bo
$40bobo14bo7bo$54bobo9bobo5$60bo$49bo9b3o$35bo12b3o7b2obo$21bo12b3o4b
3o4bob2o6b3o$20b3o4b3o4bob2o3bo2bo4b3o6b3o$13b3o4bob2o3bo2bo4b3o3bo7b
2o7b3o$13bo2bo4b3o3bo7b2o4bo3bo13b2o$13bo7b2o4bo3bo9bo3bo$13bo3bo9bo3b
o9bo$13bo3bo9bo14bobo$13bo14bobo$14bobo4$b3o$bo2bo5b3o$bo8bo2bo$bo8bo$
2bobo5bo$11bobo!
Maybe there are some modules missing in your Perl distribution? Check if the following modules are installed:

Code: Select all

DBD::SQLite
DBI
Memoize
Test::More
Ivan Fomichev

HartmutHolzwart
Posts: 840
Joined: June 27th, 2009, 10:58 am
Location: Germany

Re: Scripts for building burning helices

Post by HartmutHolzwart » January 22nd, 2014, 4:23 am

Thanks a lot for your help! I'll have a look at this as soon as I find the time and check whether the modules are actually installed.

Interestingly, the original search

helix 45 0 -17

did'n show any results, but

helix 28 -6 -6

gave quite a few! Only build-helix failed, so I couldn't interpret them correctly.

On a slightly different track: One idea to cut down the original fanout device for the caterpillar would be that the helix already provides some more gliders that could be used as input for the fanout device so that less *WSS would be needed for glider duplication. Would that be feasible? Most welcome would be a glider is emitted approximately halfway through with a timing not too different from teh one that is needed to produce the first 6 gliders that build the first six blinkers.

The length of the caterpillar depends mainly on two factors: The number of up ships that need to be constructed and the length of the forward rake needed to build one *WSS including various "noncoding DNA", i.e. blinker trails that are empty or only filled with adjuster pies.

So efficient helix + fanout is one, flexible rakes are the other.

HartmutHolzwart
Posts: 840
Joined: June 27th, 2009, 10:58 am
Location: Germany

Re: Scripts for building burning helices

Post by HartmutHolzwart » January 22nd, 2014, 6:14 pm

this helix looks interesting!

Only HWSS and LWSS and not too dense.

Something went wrong with the last part, though.

Rgds,
Hartmut

User avatar
codeholic
Moderator
Posts: 1147
Joined: September 13th, 2011, 8:23 am
Location: Hamburg, Germany

Re: Scripts for building burning helices

Post by codeholic » January 22nd, 2014, 7:00 pm

HartmutHolzwart wrote:Interestingly, the original search

helix 45 0 -17

did'n show any results
Have you changed these settings in the code?
HartmutHolzwart wrote:On a slightly different track: One idea to cut down the original fanout device for the caterpillar would be that the helix already provides some more gliders that could be used as input for the fanout device so that less *WSS would be needed for glider duplication.
That's not always possible, because sometimes fanout devices not only duplicate gliders, but also allow to adjust timing.
Ivan Fomichev

HartmutHolzwart
Posts: 840
Joined: June 27th, 2009, 10:58 am
Location: Germany

Re: Scripts for building burning helices

Post by HartmutHolzwart » January 23rd, 2014, 7:54 am

Obviously you cannot get rid of the complete fanout device!

But you could may simplify it a little in terms of *WSS support count, if e.g. the x6 helix could provide one additional glider at approximately the correct time. The you could maybe save one glider duplication.

I'll try to design an example to illustrate the point.

User avatar
biggiemac
Posts: 515
Joined: September 17th, 2014, 12:21 am
Location: California, USA

Re: Scripts for building burning helices

Post by biggiemac » December 30th, 2014, 7:55 pm

I'm running this script to find orthogonal helices that advance at 18c/59 (see current waterbear thread for reasoning), and it's returning 8 options at n=2:

Code: Select all

>perl helix.pl 59 0 -18
n=1
n=2
2527:2343:2527:4351
2527:2343:2527:5006
2527:4351:2527:2343
2527:5006:2527:2343
2527:5155:3051:1624
3051:1624:2527:5155
75:2527:5155:3084
2804:2804
n=3
^C
However, when I use build-helix to create these, the dialog in the upper left claims a different velocity for all the helices after the first one. The first shows 118 0 -36, as desired, but the next 7 all claim oblique velocities (e.g., 78 -2 -26 for the 2804:2804). Is one of the steps not working properly?
(Unfortunately, the sparks from the first helix interfere with a second iteration, so I need one of the other options if I'm to make a x2 helix)

For reference, my settings are
NO_STRAIGHTS = 0
MAX_FACTOR = 30
MAX_LENGTH = 22

Thanks,
-Brett
Physics: sophistication from simplicity.

User avatar
codeholic
Moderator
Posts: 1147
Joined: September 13th, 2011, 8:23 am
Location: Hamburg, Germany

Re: Scripts for building burning helices

Post by codeholic » December 30th, 2014, 8:13 pm

That's right, build-helix.pl is not smart enough yet to adjust a helix to a desired slope. You need to do it manually. Fortunately, it's easy to do. I'm currently working on 2804:2804, looking for a collision that would knock a glider out of the helix. Here is a gliderless variant (if it appears that two LWSS are easier to synthesise than one HWSS, that I doubt, there are plenty of ways to do so):

Code: Select all

x = 36, y = 123, rule = B3/S23
23b3o$23bo2bo$18b2o3bo$17bobo3bo$19bo4bobo6$25bo$10bo13b3o$9b3o11b2obo
$9bob2o10b3o5b3o$10b3o11b2o4bo2bo$10b2o21bo$29bo3bo$29bo3bo$33bo$30bob
o3$8b3o$8bo2bo11b3o$2bo5bo13bo2bo$b3o4bo16bo$2obo5bobo13bo$3o19bobo$3o
$3o$b2o3$25bo$10bo13b3o$9b3o12bob2o$8b2obo13b3o3b3o$8b3o14b2o4bo2bo$9b
2o20bo$31bo3bo$31bo3bo$31bo$32bobo3$8b3o$7bo2bo12b3o$2bo7bo12bo2bo$b3o
6bo12bo$bob2o2bobo13bo$2b3o19bobo$2b3o$2b3o$2b2o3$25bo$10bo13b3o$9b3o
11b2obo$9bob2o10b3o5b3o$10b3o11b2o4bo2bo$10b2o21bo$29bo3bo$29bo3bo$33b
o$30bobo3$8b3o$8bo2bo11b3o$2bo5bo13bo2bo$b3o4bo16bo$2obo5bobo13bo$3o
19bobo$3o$3o$b2o3$25bo$10bo13b3o$9b3o12bob2o$8b2obo13b3o3b3o$8b3o14b2o
4bo2bo$9b2o20bo$31bo3bo$31bo3bo$31bo$32bobo3$8b3o$7bo2bo12b3o$2bo7bo
12bo2bo$b3o6bo12bo$bob2o2bobo13bo$2b3o19bobo$2b3o$2b3o$2b2o3$25bo$10bo
13b3o$9b3o11b2obo$9bob2o10b3o5b3o$10b3o11b2o4bo2bo$10b2o21bo$29bo3bo$
29bo3bo$33bo$30bobo3$8b3o$8bo2bo$2bo5bo$b3o4bo$2obo5bobo$3o$3o$3o$b2o!
Ivan Fomichev

User avatar
biggiemac
Posts: 515
Joined: September 17th, 2014, 12:21 am
Location: California, USA

Re: Scripts for building burning helices

Post by biggiemac » December 30th, 2014, 8:18 pm

Okay, glad it's the expected behavior. That looks nice; I had been doing the same thing and the best I could find was using a MWSS and LWSS. Glad a single HWSS does the trick!

Good luck with getting it to release a glider, please keep me posted!
Physics: sophistication from simplicity.

User avatar
codeholic
Moderator
Posts: 1147
Joined: September 13th, 2011, 8:23 am
Location: Hamburg, Germany

Re: Scripts for building burning helices

Post by codeholic » December 30th, 2014, 8:29 pm

By the way, here is a near miss (if anyone's interested):

Code: Select all

x = 38, y = 59, rule = B3/S23
25b3o$25bo2bo$20b2o3bo$19bobo3bo$21bo4bobo6$27bo$12bo13b3o$11b3o11b2ob
o$11bob2o10b3o5b3o$12b3o11b2o4bo2bo$12b2o21bo$31bo3bo$31bo3bo$35bo$32b
obo3$3b3o4b3o$2bo2bo4bo2bo11b3o$5bo4bo13bo2bo$5bo4bo16bo$2bobo6bobo13b
o$24bobo4$b3o$bo2bo$bo25bo$bo10bo13b3o$2bobo6b3o12bob2o$10b2obo13b3o3b
3o$10b3o14b2o4bo2bo$11b2o20bo$33bo3bo$33bo3bo$33bo$34bobo3$3b3o4b3o$3b
o2bo2bo2bo$3bo8bo$3bo8bo$4bobo2bobo5$b3o$o2bo$3bo$3bo$obo!
Ivan Fomichev

User avatar
PC101
Posts: 173
Joined: May 9th, 2019, 11:32 pm
Location: :uoᴉʇɐɔo˥

Re: Scripts for building burning helices

Post by PC101 » July 13th, 2021, 7:44 pm

I know that this thread is really old, but I want to make a post here because I have something new to bring to this thread.
As some of you may know, codeholic's scripts to generate helixes (https://github.com/codeholic/helix) has had issues working in the past year or so. What I have done in the past few days is try to get it working again and today I was successful. I have made a tutorial on how to set up and run codeholic's scripts. If you notice anything wrong with the tutorial (yes anything, even a small typo) please let me know and I will edit this post to fix it. I recommend that you read the entire tutorial first before following it. Also make sure to save and close anything you might have open because step 4 involves restarting your computer.

Tutorial for running and using codeholic's old helix creating scripts on Windows 10 (2021):
This tutorial assumes the following:
- That the computer you are using this tutorial for does not have Golly 2.7.
- That the computer you are using this tutorial for does not have the latest version of Cygwin
- That the computer you are using this tutorial for does not have Strawberry Perl 5.10.1.2

1. Download Cygwin here: https://cygwin.com/setup-x86_64.exe (NOTE: Downloading setup-x86_64.exe from the website will replace your current version of Cygwin with the latest version available)
--- Run setup-x86_64.exe
--- Choose your installation settings and click next until you get to Cygwin Setup - Select Packages.
--- From there, go to the dropdown next to "View" on the top left of the window. Select "Full" from the dropdown
--- In the search bar look for these 4 packages: perl-DBD-SQLite, perl-DBD-SQLite-debuginfo, perl-DBI, perl-DBI-debuginfo
--- Under the "New" column for each package, click the drop arrow next to "Skip" and select the following versions:
perl-DBD-SQLite: 1.66-2(Recommended) or higher
perl-DBD-SQLite-debuginfo: 1.66-2(Recommended) or higher
perl-DBI: 1.643-2(Recommended) or higher
perl-DBI-debuginfo: 1.643-2(Recommended) or higher
--- Do not check the check marks under the "Src?" column.
--- Finish the installation

2. Download golly-2.7-win from here: https://sourceforge.net/projects/golly/ ... golly-2.7/
--- Make sure to backup your GollyPrefs file somewhere! (the file is located here: C:\Users\ <your username> \AppData\Roaming\Golly\GollyPrefs)
--- Once you make the backup, you can use Golly 2.7 however you like, but once you close Golly 2.7 you have to backup the current GollyPrefs and replace it with the original GollyPrefs that you backed up so you don't accidentally mess up any other Golly installations you might have on your computer.
--- If you want to use Golly 2.7 again please follow the "--- " steps above.

3. Download Strawberry Perl 5.10.1.2 from here: https://strawberryperl.com/releases.html
--- Download the Portable edition and unzip it to your desired location. For this tutorial, let's assume you unzipped it on your C: drive at C:\strawberry-perl-5.10.1.2-portable

4. Restart your computer (This is not optional. You have to do this in order for golly to be able to read Perl properly. I don't know why it's like this)

5. Open the strawberry-perl-5.10.1.2-portable folder
--- Double click the file called portableshell.bat
--- Type this command into the command prompt:

Code: Select all

ppm install DBI
--- Press enter and wait for the command to finish running
--- Close the command prompt window

6. Download the actual helix scripts by following these steps:
--- Open Cygwin
--- Type this command into Cygwin:

Code: Select all

git clone https://github.com/codeholic/helix
--- Press enter
--- Wait for the git clone command to finish, then close Cygwin.

7. Locate the helix folder that you git cloned. Assuming that you installed Cygwin in the default directory, it should be here: C:\cygwin64\home\<your username>\helix
--- Keep this folder open for later

8. Download build-helix.txt that is attached to this post:
build-helix.txt
MODIFIED build-helix SCRIPT
(8.69 KiB) Downloaded 85 times
--- Rename build-helix.txt to build-helix.pl

9. Copy build-helix.pl into the folder called "Perl". The location of "Perl" should be in \golly-2.7-win\Scripts\Perl.
--- Some of you may notice that build-helix.pl is located in the folder from step 7. Do not use that one and instead use the one that you have just changed from build-helix.txt to build-helix.pl

--- Go to the folder in step 7 and copy a file called 'helix.sqlite3' into \golly-2.7-win\Scripts\Perl.

10. Open Golly 2.7 through Golly.exe (located in golly-2.7-win folder)

11. On the top right of Golly 2.7, click "File" --> "Run Script"

12. Golly should have opened file explorer after clicking "Run script"
--- In the file explorer that Golly opened up, locate the "Perl" folder in step 8 and double-click build-helix.pl
--- At this point Golly should give an error window that is titled "Could not load the Perl library"
--- The directory for the perl*.dll file is \strawberry-perl-5.10.1.2-portable\perl\bin\perl510.dll.
--- Press "OK"
--- Now close Golly and all windows that Golly has opened.

After completing all these steps you are finally ready to generate helixes.
Follow the steps below to actually run the scripts to generate your helixes.

13. Open Cygwin
--- Type cd helix
--- Run helix.pl with this command: ./helix.pl <period> <x-displacement> <y-displacement> (you should replace <period> <x-displacement <y-displacement> with the velocity of the helix you want to find)
As an example, replace <period> with 45, <x-displacement> with 0, and <y-displacement> with -17 to generate helixes for the original caterpillar.
--- See this thread for some variables that might need to be tweaked manually in helix.pl in order to get the helix results you want: viewtopic.php?f=9&t=1267
--- Once you run the ./helix.pl <period> <x-displacement> <y-displacement> command after tweaking the variables you should get an output that resembles something like this:

Code: Select all

n=1
n=2
n=3
n=4
572:572:572:3051:5155:2527:1624
572:572:3653:3653:5155:1202:75
572:572:1624:3653:3653:1624
572:1202:3653:5155:572:3653:75
572:2527:2527:5155:2527:2527:2343
572:3653:3653:3653:75:2527:1749
572:3653:3653:3653:703:2527:1624
572:3653:3653:1624:2527:3653:703
572:3653:3653:1749:2527:3653:75
572:3653:75:572:1202:3653:5155
572:3653:1624:572:3653:1624
1202:75:572:572:3653:3653:5155
2527:2527:2343:572:2527:2527:5155
2527:3653:75:572:3653:3653:1749
2527:3653:703:572:3653:3653:1624
2527:1624:572:572:572:3051:5155
2527:1624:572:3653:3653:3653:703
2527:1749:572:3653:3653:3653:75
3653:3653:1624:572:572:1624
n=5
--- It's ok if the numbers in the example above are not the same as yours. They aren't really meant to be the same. The point is that you should have a combination of n=whatever and number:number:number:number:number:number:number in your output.
--- Do not close Cygwin

14. Open Golly 2.7
--- Do step 11
--- Run build-helix.pl in the "Perl" folder (not build-helix.pl from the "helix" folder in step 7)
--- A window with no title and a text box that you can type in should have opened after running build-helix.pl. In the text box, copy and paste any of the number:number:number:number:number:number:number into the text box and press "OK". Once you press "OK" the helix should have generated in golly.
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?

The (34,7)c/156 caterpillar is finished!!! You can download it here.

User avatar
yujh
Posts: 3066
Joined: February 27th, 2020, 11:23 pm
Location: I'm not sure where I am, so please tell me if you know
Contact:

Re: Scripts for building burning helices

Post by yujh » July 13th, 2021, 8:03 pm

Golly 2.7? Who else is using that? I think this script should probably get updated
Rule modifier

B34kz5e7c8/S23-a4ityz5k
b2n3-q5y6cn7s23-k4c8
B3-kq6cn8/S2-i3-a4ciyz8
B3-kq4z5e7c8/S2-ci3-a4ciq5ek6eik7

Bored of Conway's Game of Life? Try Pedestrian Life -- not pedestrian at all!

AforAmpere
Posts: 1334
Joined: July 1st, 2016, 3:58 pm

Re: Scripts for building burning helices

Post by AforAmpere » July 13th, 2021, 8:21 pm

This Python script should work as a replacement for build_helix.pl, hopefully. sqlite3 is there by default, so nothing extra should have to be installed.

Code: Select all

import golly as g
import sqlite3
import math

GLIDER_CELLS = {'gl_ne':g.parse('b2o$obo$2bo!'),'gl_nw':g.parse('2o$obo$o!')}

def fetch(id):
	global cur
	cur.execute("""SELECT p.pId, p.rle, p.sizeX, p.sx, p.sy, r.dt, r.dx, r.dy, r.object
FROM pattern p INNER JOIN result r ON r.pId = p.pId
WHERE p.pId = ? AND p.start = 'gl_ne' AND r.object IN (?, ?)""",(id, 'gl_ne', 'gl_nw'))
	pattern = list(cur.fetchall()[0])
	pattern[1] = g.parse(str(pattern[1]))
	if(not pattern):
                g.exit("Couldn't find id")
	return pattern

def subtract(cells, sub):
        sub2 = [[sub[i],sub[i+1]] for i in range(0,len(sub),2)]
        ret=[]
        for i in range(0,len(cells),2):
                if [cells[i],cells[i+1]] not in sub2:
                        ret+=[cells[i],cells[i+1]]
        if len(cells)!=len(ret)+len(sub):
                return []
        return ret

def normalize(cells):
        a = sorted([[cells[i],cells[i+1]] for i in range(0,len(cells),2)])
        b=[]
        for i in a:
                b+=a
        return b

def bounding_box(cells):
        a = [[cells[i],cells[i+1]] for i in range(0,len(cells),2)]
        return [min([x[0] for x in a]), min([x[1] for x in a]), max([x[0] for x in a]), max([x[1] for x in a])]

def remove_start_glider(pattern):
        x0 = pattern[3]-2
        y0 = pattern[4]
        sub = g.transform(GLIDER_CELLS['gl_ne'],x0,y0)
        diff = subtract(pattern[1],sub)

        if(not diff):
                g.exit("Couldn't remove start glider")

        return diff
        

def attach(last, nex):
        axx=1 if last[8]=='gl_ne' else -1
        last_cells = g.transform(last[1],(last[2]-1 if axx<1 else 0),0,axx)
        nex_cells = remove_start_glider(nex)

        dt = last[5]
        dx = last[6]
        dy = last[7]

        ex = last[3]+dx
        ey = last[4]+dy
        if(axx<0):
                ex = last[2]-1-ex

        found=0
        result = []
        h = 0
        
        h-=1
        dt-=4
        dx-=axx
        dy+=1
        ex-=1
        ey+=1
        while h<100:
                h+=1
                dt+=4
                dx+=axx
                dy-=1
                ex+=1
                ey-=1
                x0=ex-nex[3]
                y0=ey-nex[4]+int(math.ceil(dt/4.0)*2)
                nex_cells0=g.transform(nex_cells,x0,y0)
                nex_cells0=g.evolve(nex_cells0,(-dt) %4)

                result = g.join(last_cells,nex_cells0)
                if len(result) != len(last_cells+nex_cells0):
                        continue

                end = g.evolve(result, dt+nex[5])
                glider = GLIDER_CELLS[nex[8]]
                x0=ex+nex[6]-(2 if nex[8]=='gl_ne' else 0)
                y0=ey+nex[7]
                glider=g.transform(glider,x0,y0)
                end=subtract(end,glider)
                if not end:
                        continue

                found+=1
                break
        xmin,ymin,xmax,ymax = bounding_box(result)
        sizeX = xmax-xmin+1
        if axx<0: result = g.transform(result,sizeX-1,0,axx)

        sx = last[3]+(0 if axx>0 else sizeX-last[2])

        if not found:
                      g.getstring("Couldn't attach next's pId to last's pId")
                      return;
        return [str(last[0])+":"+str(last[1]),result, sizeX, sx, last[4], dt+nex[5],dx+axx*nex[6],dy+nex[7],'gl_nw' if ((axx>0)!=(nex[8]=='gl_ne')) else 'gl_ne']

dbh = sqlite3.connect('helix.sqlite3')
cur = dbh.cursor()

g.new('')
g.setrule('B3/S23')

p = list(map(fetch, g.getstring('Input colon-separated string input').split(":")))
r = p[0]
for i in range(1,len(p)):
	r=attach(r,p[i])

g.putcells(r[1])
I manage the 5S project, which collects all known spaceship speeds in Isotropic Non-totalistic rules. I also wrote EPE, a tool for searching in the INT rulespace.

Things to work on:
- Find (7,1)c/8 and 9c/10 ships in non-B0 INT.
- EPE improvements.

Post Reply