Spaceships in Life-like cellular automata

For discussion of other cellular automata.
Naszvadi
Posts: 1244
Joined: May 7th, 2016, 8:53 am
Contact:

Re: Spaceships in Life-like cellular automata

Post by Naszvadi » April 3rd, 2020, 12:39 pm

LaundryPizza03 wrote:
April 3rd, 2020, 10:54 am
Naszvadi wrote:
April 2nd, 2020, 10:51 am
LaundryPizza03 wrote:
April 2nd, 2020, 6:31 am


How do I specify the file I'm working with? Also, is there a Golly script that automates the generation of lines?
Answering the first: grep is a standard unix/posix/whatever utility, so on most unixish command line environments: "man grep" (man stands for manual) gives interactive help.

Short recipe: grep [-switches begin with "-" or "--"] "first_positional_parameter_is_a_regexp" firstfile1.txt secondfile2.txt

Calling grep without any files specified, it parses STDIN instead of opening regular files.

Answering the second question: TBD :-)

Other remark: the regular expression I gave you is weird for an unexperienced one, I am a little bit familiar with it. Also it has some tweaks for example: checks and accepts rules in certain fields with substring B2 or B3 or B0, so this regular expression cannot be applied for validation oscillator CSV databases without some modification!

Due to my increased spare time, I am gladly answer such question and support such code snippets :-)
It's still not working. I am using macOS Catalina.

Code: Select all

grep -Ev '^[^:]*:[^:]*:B([023])[1-8]{0,8}/S[0-8]{0,9}:B\1[1-8]{0,8}/S[0-8]{0,9}:[1-9][0-9]{0,7}(|/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$' /Users/gb/Documents/new-gliders.db.txt
grep: empty (sub)expression
Hmmm... sounds strange! The grep command with "-E" switch must accept _extended_ regular expression instead of _basic_ (r.e.), and both are POSIX standards. Those are basically the same, except that the roles of curly braces, parentheses, question mark and plus sign are swapped with their backslash-quoted versions. And also one-character command line switches that has NO parameters and has exactly one preceeding dash - can be grouped, so "-Ev" basically equivalent to specifying "-E" "-v" in disorder.

Is there an egrep or ggrep on your machine? What is the output of these two commands - trying to determine Catalina's grep version:

Code: Select all

grep --help

man grep | tail

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

Re: Spaceships in Life-like cellular automata

Post by LaundryPizza03 » April 3rd, 2020, 2:05 pm

Naszvadi wrote:
April 3rd, 2020, 12:39 pm
LaundryPizza03 wrote:
April 3rd, 2020, 10:54 am
Naszvadi wrote:
April 2nd, 2020, 10:51 am


Answering the first: grep is a standard unix/posix/whatever utility, so on most unixish command line environments: "man grep" (man stands for manual) gives interactive help.

Short recipe: grep [-switches begin with "-" or "--"] "first_positional_parameter_is_a_regexp" firstfile1.txt secondfile2.txt

Calling grep without any files specified, it parses STDIN instead of opening regular files.

Answering the second question: TBD :-)

Other remark: the regular expression I gave you is weird for an unexperienced one, I am a little bit familiar with it. Also it has some tweaks for example: checks and accepts rules in certain fields with substring B2 or B3 or B0, so this regular expression cannot be applied for validation oscillator CSV databases without some modification!

Due to my increased spare time, I am gladly answer such question and support such code snippets :-)
It's still not working. I am using macOS Catalina.

Code: Select all

grep -Ev '^[^:]*:[^:]*:B([023])[1-8]{0,8}/S[0-8]{0,9}:B\1[1-8]{0,8}/S[0-8]{0,9}:[1-9][0-9]{0,7}(|/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$' /Users/gb/Documents/new-gliders.db.txt
grep: empty (sub)expression
Hmmm... sounds strange! The grep command with "-E" switch must accept _extended_ regular expression instead of _basic_ (r.e.), and both are POSIX standards. Those are basically the same, except that the roles of curly braces, parentheses, question mark and plus sign are swapped with their backslash-quoted versions. And also one-character command line switches that has NO parameters and has exactly one preceeding dash - can be grouped, so "-Ev" basically equivalent to specifying "-E" "-v" in disorder.

Is there an egrep or ggrep on your machine? What is the output of these two commands - trying to determine Catalina's grep version:

Code: Select all

grep --help

man grep | tail
There is egrep, but no ggrep.

Code: Select all

> grep --help
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
> man grep | tail
     strongly discouraged.

HISTORY
     The grep command first appeared in Version 6 AT&T UNIX.

BUGS
     The grep utility does not normalize Unicode input, so a pattern contain-
     ing composed characters will not match decomposed input, and vice versa.

BSD                              July 28, 2010                             BSD

Code: Select all

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

Naszvadi
Posts: 1244
Joined: May 7th, 2016, 8:53 am
Contact:

Re: Spaceships in Life-like cellular automata

Post by Naszvadi » April 3rd, 2020, 2:23 pm

LaundryPizza03 wrote:
April 3rd, 2020, 2:05 pm
Naszvadi wrote:
April 3rd, 2020, 12:39 pm
LaundryPizza03 wrote:
April 3rd, 2020, 10:54 am


It's still not working. I am using macOS Catalina.

Code: Select all

grep -Ev '^[^:]*:[^:]*:B([023])[1-8]{0,8}/S[0-8]{0,9}:B\1[1-8]{0,8}/S[0-8]{0,9}:[1-9][0-9]{0,7}(|/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$' /Users/gb/Documents/new-gliders.db.txt
grep: empty (sub)expression
Hmmm... sounds strange! The grep command with "-E" switch must accept _extended_ regular expression instead of _basic_ (r.e.), and both are POSIX standards. Those are basically the same, except that the roles of curly braces, parentheses, question mark and plus sign are swapped with their backslash-quoted versions. And also one-character command line switches that has NO parameters and has exactly one preceeding dash - can be grouped, so "-Ev" basically equivalent to specifying "-E" "-v" in disorder.

Is there an egrep or ggrep on your machine? What is the output of these two commands - trying to determine Catalina's grep version:

Code: Select all

grep --help

man grep | tail
There is egrep, but no ggrep.

Code: Select all

> grep --help
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
> man grep | tail
     strongly discouraged.

HISTORY
     The grep command first appeared in Version 6 AT&T UNIX.

BUGS
     The grep utility does not normalize Unicode input, so a pattern contain-
     ing composed characters will not match decomposed input, and vice versa.

BSD                              July 28, 2010                             BSD
Hmm. As a proud owner of several m68k-ppc-G3-G4 macs including rare vintage ones as well as 1.8GHz cube on streroids, and as a fan of Unices, I am always aware about that the BSD CLI utilities in OSX has less features, but it is definiately vintage! However, it seems that the regexp backreference "\1" would cause the glitch for the parser engine. Well, a feature-less version of my oneliner, try this out:

Code: Select all

egrep -v '^[^:]*:[^:]*:B[0-8]{0,8}/S[0-8]{0,9}:B[0-8]{0,8}/S[0-8]{0,9}:[1-9][0-9]{0,7}(|/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$' /Users/gb/Documents/new-gliders.db.txt
The other possible caveats are for the above version: won't accect question mark (usually a short term for {0,1}).

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

Re: Spaceships in Life-like cellular automata

Post by LaundryPizza03 » April 4th, 2020, 5:00 pm

Naszvadi wrote:
April 3rd, 2020, 2:23 pm
LaundryPizza03 wrote:
April 3rd, 2020, 2:05 pm
Naszvadi wrote:
April 3rd, 2020, 12:39 pm


Hmmm... sounds strange! The grep command with "-E" switch must accept _extended_ regular expression instead of _basic_ (r.e.), and both are POSIX standards. Those are basically the same, except that the roles of curly braces, parentheses, question mark and plus sign are swapped with their backslash-quoted versions. And also one-character command line switches that has NO parameters and has exactly one preceeding dash - can be grouped, so "-Ev" basically equivalent to specifying "-E" "-v" in disorder.

Is there an egrep or ggrep on your machine? What is the output of these two commands - trying to determine Catalina's grep version:

Code: Select all

grep --help

man grep | tail
There is egrep, but no ggrep.

Code: Select all

> grep --help
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
> man grep | tail
     strongly discouraged.

HISTORY
     The grep command first appeared in Version 6 AT&T UNIX.

BUGS
     The grep utility does not normalize Unicode input, so a pattern contain-
     ing composed characters will not match decomposed input, and vice versa.

BSD                              July 28, 2010                             BSD
Hmm. As a proud owner of several m68k-ppc-G3-G4 macs including rare vintage ones as well as 1.8GHz cube on streroids, and as a fan of Unices, I am always aware about that the BSD CLI utilities in OSX has less features, but it is definiately vintage! However, it seems that the regexp backreference "\1" would cause the glitch for the parser engine. Well, a feature-less version of my oneliner, try this out:

Code: Select all

egrep -v '^[^:]*:[^:]*:B[0-8]{0,8}/S[0-8]{0,9}:B[0-8]{0,8}/S[0-8]{0,9}:[1-9][0-9]{0,7}(|/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$' /Users/gb/Documents/new-gliders.db.txt
The other possible caveats are for the above version: won't accect question mark (usually a short term for {0,1}).
I still can't get it to work.

Code: Select all

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

Naszvadi
Posts: 1244
Joined: May 7th, 2016, 8:53 am
Contact:

Re: Spaceships in Life-like cellular automata

Post by Naszvadi » April 5th, 2020, 6:14 am

LaundryPizza03 wrote:
April 4th, 2020, 5:00 pm
Naszvadi wrote:
April 3rd, 2020, 2:23 pm
LaundryPizza03 wrote:
April 3rd, 2020, 2:05 pm


There is egrep, but no ggrep.

Code: Select all

> grep --help
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
> man grep | tail
     strongly discouraged.

HISTORY
     The grep command first appeared in Version 6 AT&T UNIX.

BUGS
     The grep utility does not normalize Unicode input, so a pattern contain-
     ing composed characters will not match decomposed input, and vice versa.

BSD                              July 28, 2010                             BSD
Hmm. As a proud owner of several m68k-ppc-G3-G4 macs including rare vintage ones as well as 1.8GHz cube on streroids, and as a fan of Unices, I am always aware about that the BSD CLI utilities in OSX has less features, but it is definiately vintage! However, it seems that the regexp backreference "\1" would cause the glitch for the parser engine. Well, a feature-less version of my oneliner, try this out:

Code: Select all

egrep -v '^[^:]*:[^:]*:B[0-8]{0,8}/S[0-8]{0,9}:B[0-8]{0,8}/S[0-8]{0,9}:[1-9][0-9]{0,7}(|/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$' /Users/gb/Documents/new-gliders.db.txt
The other possible caveats are for the above version: won't accect question mark (usually a short term for {0,1}).
I still can't get it to work.
Hmmm, sounds weird. It should NOT print anything if and only if "/Users/gb/Documents/new-gliders.db.txt" is valid. In that case, the return value byte, the so-called "errorlevel value" is set to 1. (For bourne-korn shell novices: means means true, 1..255 mean false, it's a kind of unusual boolean translation of the return value of the processes, but a standard for decades.)

I collected some tests:

Code: Select all

echo 'Please, match me!!! MaTch     me my darling!'   |   egrep -io 'match +me'
# match me
# MaTch     me
echo 'hohohoahahahihi'   |   egrep -o '(..)\1'
# hoho
# ahah
# hihi

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

Re: Spaceships in Life-like cellular automata

Post by LaundryPizza03 » April 6th, 2020, 1:48 am

Naszvadi wrote:
April 5th, 2020, 6:14 am
LaundryPizza03 wrote:
April 4th, 2020, 5:00 pm
Naszvadi wrote:
April 3rd, 2020, 2:23 pm


Hmm. As a proud owner of several m68k-ppc-G3-G4 macs including rare vintage ones as well as 1.8GHz cube on streroids, and as a fan of Unices, I am always aware about that the BSD CLI utilities in OSX has less features, but it is definiately vintage! However, it seems that the regexp backreference "\1" would cause the glitch for the parser engine. Well, a feature-less version of my oneliner, try this out:

Code: Select all

egrep -v '^[^:]*:[^:]*:B[0-8]{0,8}/S[0-8]{0,9}:B[0-8]{0,8}/S[0-8]{0,9}:[1-9][0-9]{0,7}(|/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$' /Users/gb/Documents/new-gliders.db.txt
The other possible caveats are for the above version: won't accect question mark (usually a short term for {0,1}).
I still can't get it to work.
Hmmm, sounds weird. It should NOT print anything if and only if "/Users/gb/Documents/new-gliders.db.txt" is valid. In that case, the return value byte, the so-called "errorlevel value" is set to 1. (For bourne-korn shell novices: means means true, 1..255 mean false, it's a kind of unusual boolean translation of the return value of the processes, but a standard for decades.)

I collected some tests:

Code: Select all

echo 'Please, match me!!! MaTch     me my darling!'   |   egrep -io 'match +me'
# match me
# MaTch     me
echo 'hohohoahahahihi'   |   egrep -o '(..)\1'
# hoho
# ahah
# hihi
Those work fine.

Code: Select all

echo 'You're weird'   |   egrep -io 'match +me'
#
echo 'Tiny Tibby is the troublesome teenager from Turkey who eats dirt and toenails.'   |   egrep -io 'T[^b]*'
# Tiny Ti
# the trou
# teenager from Turkey who eats dirt and toenails.
echo 'B3/S23 B0ring B017/S1 texas B2/S B39/S B2/S9 B36/S125 S1 SO(32) '   |   egrep -io 'B[0-8]{0,8}/S[0-8]{0,9} '
# B3/S23 
# B017/S1 
# B2/S 
# B36/S125 
The specific regex seems to be the problem.

Code: Select all

echo 'Glider:John Conway, 1970:B3/S23:B3678/S0235678:4/2:-1:-1:3:3:bo$o$3o!'   |   egrep -io '^[^:]*:[^:]*:B[0-8]{0,8}/S[0-8]{0,9}:B[0-8]{0,8}/S[0-8]{0,9}:[1-9][0-9]{0,7}(|/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$'
# Glider:John Conway, 1970:B3/S23:B3678/S0235678:4/2:-1:-1:3:3:bo$o$3o!
egrep: empty (sub)expression

Code: Select all

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

Naszvadi
Posts: 1244
Joined: May 7th, 2016, 8:53 am
Contact:

Re: Spaceships in Life-like cellular automata

Post by Naszvadi » April 6th, 2020, 2:33 am

LaundryPizza03 wrote:
April 6th, 2020, 1:48 am
Naszvadi wrote:
April 5th, 2020, 6:14 am
LaundryPizza03 wrote:
April 4th, 2020, 5:00 pm


I still can't get it to work.
Hmmm, sounds weird. It should NOT print anything if and only if "/Users/gb/Documents/new-gliders.db.txt" is valid. In that case, the return value byte, the so-called "errorlevel value" is set to 1. (For bourne-korn shell novices: means means true, 1..255 mean false, it's a kind of unusual boolean translation of the return value of the processes, but a standard for decades.)

I collected some tests:

Code: Select all

echo 'Please, match me!!! MaTch     me my darling!'   |   egrep -io 'match +me'
# match me
# MaTch     me
echo 'hohohoahahahihi'   |   egrep -o '(..)\1'
# hoho
# ahah
# hihi
Those work fine.

Code: Select all

echo 'You're weird'   |   egrep -io 'match +me'
#
echo 'Tiny Tibby is the troublesome teenager from Turkey who eats dirt and toenails.'   |   egrep -io 'T[^b]*'
# Tiny Ti
# the trou
# teenager from Turkey who eats dirt and toenails.
echo 'B3/S23 B0ring B017/S1 texas B2/S B39/S B2/S9 B36/S125 S1 SO(32) '   |   egrep -io 'B[0-8]{0,8}/S[0-8]{0,9} '
# B3/S23 
# B017/S1 
# B2/S 
# B36/S125 
The specific regex seems to be the problem.

Code: Select all

echo 'Glider:John Conway, 1970:B3/S23:B3678/S0235678:4/2:-1:-1:3:3:bo$o$3o!'   |   egrep -io '^[^:]*:[^:]*:B[0-8]{0,8}/S[0-8]{0,9}:B[0-8]{0,8}/S[0-8]{0,9}:[1-9][0-9]{0,7}(|/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$'
# Glider:John Conway, 1970:B3/S23:B3678/S0235678:4/2:-1:-1:3:3:bo$o$3o!
egrep: empty (sub)expression
Howly macaroni! The empty subpattern is invalid in BSD regexp engine? In that case, reformulated:

Code: Select all

grep -E -n -v '^[^:]*:[^:]*:B([023])[1-8]{0,8}/S[0-8]{0,9}:B\1[1-8]{0,8}/S[0-8]{0,9}:([1-9][0-9]{0,7}|[1-9][0-9]{0,7}/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$'
Now strictly decremented the total number of bugs!

For oscillators, the corresponding regexp must allow wider "birth" rulestring parts:

Code: Select all

grep -E -n -v '^[^:]*:[^:]*:B[0-8]{0,9}/S[0-8]{0,9}:B[0-8]{0,9}/S[0-8]{0,9}:([1-9][0-9]{0,7}|[1-9][0-9]{0,7}/[0-9]+):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$'

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

Re: Spaceships in Life-like cellular automata

Post by LaundryPizza03 » April 6th, 2020, 6:13 am

Naszvadi wrote:
April 6th, 2020, 2:33 am
LaundryPizza03 wrote:
April 6th, 2020, 1:48 am
Naszvadi wrote:
April 5th, 2020, 6:14 am


Hmmm, sounds weird. It should NOT print anything if and only if "/Users/gb/Documents/new-gliders.db.txt" is valid. In that case, the return value byte, the so-called "errorlevel value" is set to 1. (For bourne-korn shell novices: means means true, 1..255 mean false, it's a kind of unusual boolean translation of the return value of the processes, but a standard for decades.)

I collected some tests:

Code: Select all

echo 'Please, match me!!! MaTch     me my darling!'   |   egrep -io 'match +me'
# match me
# MaTch     me
echo 'hohohoahahahihi'   |   egrep -o '(..)\1'
# hoho
# ahah
# hihi
Those work fine.

Code: Select all

echo 'You're weird'   |   egrep -io 'match +me'
#
echo 'Tiny Tibby is the troublesome teenager from Turkey who eats dirt and toenails.'   |   egrep -io 'T[^b]*'
# Tiny Ti
# the trou
# teenager from Turkey who eats dirt and toenails.
echo 'B3/S23 B0ring B017/S1 texas B2/S B39/S B2/S9 B36/S125 S1 SO(32) '   |   egrep -io 'B[0-8]{0,8}/S[0-8]{0,9} '
# B3/S23 
# B017/S1 
# B2/S 
# B36/S125 
The specific regex seems to be the problem.

Code: Select all

echo 'Glider:John Conway, 1970:B3/S23:B3678/S0235678:4/2:-1:-1:3:3:bo$o$3o!'   |   egrep -io '^[^:]*:[^:]*:B[0-8]{0,8}/S[0-8]{0,9}:B[0-8]{0,8}/S[0-8]{0,9}:[1-9][0-9]{0,7}(|/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$'
# Glider:John Conway, 1970:B3/S23:B3678/S0235678:4/2:-1:-1:3:3:bo$o$3o!
egrep: empty (sub)expression
Howly macaroni! The empty subpattern is invalid in BSD regexp engine? In that case, reformulated:

Code: Select all

grep -E -n -v '^[^:]*:[^:]*:B([023])[1-8]{0,8}/S[0-8]{0,9}:B\1[1-8]{0,8}/S[0-8]{0,9}:([1-9][0-9]{0,7}|[1-9][0-9]{0,7}/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$'
Now strictly decremented the total number of bugs!

For oscillators, the corresponding regexp must allow wider "birth" rulestring parts:

Code: Select all

grep -E -n -v '^[^:]*:[^:]*:B[0-8]{0,9}/S[0-8]{0,9}:B[0-8]{0,9}/S[0-8]{0,9}:([1-9][0-9]{0,7}|[1-9][0-9]{0,7}/[0-9]+):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$'
Those work, except that the RLEs in my files have a lot of unnecessary newlines that need cleaning up. How can I automatically fix or prevent this?
oscillators.db.txt
Needs cleanup
(83.23 KiB) Downloaded 158 times
new-gliders.db.txt
Needs cleanup
(3.86 MiB) Downloaded 165 times

Code: Select all

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

Naszvadi
Posts: 1244
Joined: May 7th, 2016, 8:53 am
Contact:

Re: Spaceships in Life-like cellular automata

Post by Naszvadi » April 6th, 2020, 8:55 am

LaundryPizza03 wrote:
April 6th, 2020, 6:13 am
Naszvadi wrote:
April 6th, 2020, 2:33 am
LaundryPizza03 wrote:
April 6th, 2020, 1:48 am


Those work fine.

Code: Select all

echo 'You're weird'   |   egrep -io 'match +me'
#
echo 'Tiny Tibby is the troublesome teenager from Turkey who eats dirt and toenails.'   |   egrep -io 'T[^b]*'
# Tiny Ti
# the trou
# teenager from Turkey who eats dirt and toenails.
echo 'B3/S23 B0ring B017/S1 texas B2/S B39/S B2/S9 B36/S125 S1 SO(32) '   |   egrep -io 'B[0-8]{0,8}/S[0-8]{0,9} '
# B3/S23 
# B017/S1 
# B2/S 
# B36/S125 
The specific regex seems to be the problem.

Code: Select all

echo 'Glider:John Conway, 1970:B3/S23:B3678/S0235678:4/2:-1:-1:3:3:bo$o$3o!'   |   egrep -io '^[^:]*:[^:]*:B[0-8]{0,8}/S[0-8]{0,9}:B[0-8]{0,8}/S[0-8]{0,9}:[1-9][0-9]{0,7}(|/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$'
# Glider:John Conway, 1970:B3/S23:B3678/S0235678:4/2:-1:-1:3:3:bo$o$3o!
egrep: empty (sub)expression
Howly macaroni! The empty subpattern is invalid in BSD regexp engine? In that case, reformulated:

Code: Select all

grep -E -n -v '^[^:]*:[^:]*:B([023])[1-8]{0,8}/S[0-8]{0,9}:B\1[1-8]{0,8}/S[0-8]{0,9}:([1-9][0-9]{0,7}|[1-9][0-9]{0,7}/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$'
Now strictly decremented the total number of bugs!

For oscillators, the corresponding regexp must allow wider "birth" rulestring parts:

Code: Select all

grep -E -n -v '^[^:]*:[^:]*:B[0-8]{0,9}/S[0-8]{0,9}:B[0-8]{0,9}/S[0-8]{0,9}:([1-9][0-9]{0,7}|[1-9][0-9]{0,7}/[0-9]+):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[$bo0-9]+!$'
Those work, except that the RLEs in my files have a lot of unnecessary newlines that need cleaning up. How can I automatically fix or prevent this?

oscillators.db.txt
new-gliders.db.txt
Need your perl version (all lowercase):

Code: Select all

perl -v
There are several cod(egolf)ing ways for automatically tidying such generalized CSV darabases.

First of all, in any bourne-like environment like bash: you should include "set +H" in your interactive environment's startup, because without this, the exclamation mark in CLI can cause weird effects and even data loss (it looks up and substitutes from history etc, which could definiately be improductive in productive environment).

Why? Because "!" is a common record line delimiter (if rle is put onto the end of the line)

Then one way I haven't used before, but this checker script seems to be okay:

Code: Select all

cat   ./file.php\?id\=3155_new-gliders.db.txt     \
|   perl -0x21 -pe 'chomp;s/[\r|\n]//g;s/$/!\n/g' \    
| grep -Ev '^[^:]*:[^:]*:B([023])[1-8]{0,8}/S[0-8]{0,9}:B\1[1-8]{0,8}/S[0-8]{0,9}:([1-9][0-9]{0,7}|[1-9][0-9]{0,7}/[12]):[-]?[0-9]{1,7}:[-]?[0-9]{1,7}:[1-9][0-9]{0,7}:[1-9][0-9]{0,7}:[\$bo0-9]+!$'
No whitespaces after the trailing backslashes in bash/ksh etc, it allows split rows to be entered.

Short explanation:
  • cat ... : conCATenates files given in parameter list to STDOUT
  • | perl : calls perl interpreter, usually it is delivered with most BSD, Linux and OSX distributions
  • -0x21 : the "dashzero" parameter and a x?? value sets the default input record separator other than CHR$(10), it is tricky, but a smart assumption that every line MUST contain a trailing "!" without quotes, of course!
  • -pe : tells the perl interpreter that the next parameter is a perl code to be executed in a "while(<>){...}print"$_";" loop, a shortcut for sequential line processing
  • 'chomp; s/[\r|\n]//g; s/$/!\n/g' : chomp cuts down unnecessary record separators, this time '!'m the first regex deletes all newlines and carriage returns, the db is usually polluted by the latter. The second regex append a "!\n" to the so-called topic variable "$_" that will be printed after processing a "record" (line).
A db tidying one-liner:

Code: Select all

perl -i.backup -0x21 -n -e 'chomp;s/[\r|\n]//g;print"$_!\n"'     ../file.php\?id\=3155_new-gliders.db.txt
This will make a backup copy with extension ".backup" of each currently processed input file if it is NOT a STDIN, and then executes script and its STDOUT will be redirected to the original file.

At your own risk!

Well, I have a dream: a git or similar content tracker repository in which one can push changes to pattern123456.db and for each code verification step: an automatical static code checker job validates the modified files, votes, and if vote is acceptable, the reviewer tools merges the change.

git and gerrit for example would be a decent choice for the above (at least I am familiar with them)

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

Re: Spaceships in Life-like cellular automata

Post by LaundryPizza03 » April 6th, 2020, 5:24 pm

Okay, here's the fixed version:
new-db.zip
First one as a zip file. Contains 22340 ships and 394 oscillators.
(1 MiB) Downloaded 178 times

Code: Select all

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

Naszvadi
Posts: 1244
Joined: May 7th, 2016, 8:53 am
Contact:

Re: Spaceships in Life-like cellular automata

Post by Naszvadi » April 7th, 2020, 8:05 am

LaundryPizza03 wrote:
April 6th, 2020, 5:24 pm
Okay, here's the fixed version:
new-db.zip
Seems to be okay for me, the only differences found using "/usr/bin/diff" is: one corrected spaceship rle, one comma added to a comment column and the third is several spaceship records had been appended:
Well done!

Now next stage is: deduplication/automatic flip-mirror-rotate patterns to store only minimal forms. Ordering function should be diameter (minimal bounding boxes longer edge), then shorter edge, and selecting the minima among the 4 possible mirrored versions per pattern (at most 8 transformed shapes could exist when the minimal bounding box is a square). Automatic verification of period, flipping number, speed, move etc.

I'd rather add or extend columns with isotropic nontotalistic supported rules!

With or without "import golly", the above features would be handy/challenging/respectable!

User avatar
Saka
Posts: 3627
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: Spaceships in Life-like cellular automata

Post by Saka » April 8th, 2020, 11:03 am

I think this fits here.
2 c/7o ships in Diamoeba. They might be known, but I'm not sure

Code: Select all

x = 28, y = 30, rule = B35678/S5678
16bo$16b6o$2bobo9bob8o$b4o3bo5b10o$2b5obobob14o$26o$26o$2b5obobob14o$b
4o3bo5b10o$2bobo9bob8o$16b6o$16bo7$21bobo$17bobobobo$2bobo12b9o$b4o3bo
5bob10o$2b5obobobob14o$28o$28o$2b5obobobob14o$b4o3bo5bob10o$2bobo12b9o
$17bobobobo$21bobo!
They remind me of Lacrymaria.

Naszvadi
Posts: 1244
Joined: May 7th, 2016, 8:53 am
Contact:

Re: Spaceships in Life-like cellular automata

Post by Naszvadi » April 8th, 2020, 1:55 pm

Saka wrote:
April 8th, 2020, 11:03 am
I think this fits here.
2 c/7o ships in Diamoeba. They might be known, but I'm not sure

Code: Select all

x = 28, y = 30, rule = B35678/S5678
16bo$16b6o$2bobo9bob8o$b4o3bo5b10o$2b5obobob14o$26o$26o$2b5obobob14o$b
4o3bo5b10o$2bobo9bob8o$16b6o$16bo7$21bobo$17bobobobo$2bobo12b9o$b4o3bo
5bob10o$2b5obobobob14o$28o$28o$2b5obobobob14o$b4o3bo5bob10o$2bobo12b9o
$17bobobobo$21bobo!
They remind me of Lacrymaria.
The bigger one had been discovered by David Eppstein, source: http://entropymine.com/jason/life/alt/diamoeba-c7.lif

Bottom line, 5th from left:

Code: Select all

#CDiamoeba c/7 spaceships
#CFound by David Eppstein, 11-Mar-1999 - 24-Mar-1999
x = 249, y = 114, rule = B35678/S5678
74b2o$74b2o47b2o45b2o$38b4o13b4o14b4o46b2o45b2o$38b4o13b4o14b4o45b4o
42b6o41b2o$37b6o10b8o10b8o43b4o42b6o41b2o18b2o$37b6o10b8o10b8o22b4o15b
8o38b10o21b2o14b6o16b2o$35b10o8b8o10b8o22b4o17b4o40b10o21b2o15b4o15b6o
$20b2o13b10o7b10o9b3o2b3o20b8o14b6o42bo2bo23b4o13b6o14b6o$20b2o16bo2bo
58b6o16b4o41b3o2b3o21b4o14b4o13b10o$18b6o14bo2bo11b3o2b3o11b2o2b2o20b
10o12b8o66b8o10b8o12b8o$18b6o31bo2bo41b6o16b4o41bobo2bobo20b6o13b4o15b
6o$17b8o12b6o11bob2obo12bob2obo21b8o14b6o42b4o20b10o10b6o12b4o2b4o$18b
6o14b4o12bob2obo12b6o22b6o16b4o23b4o14b8o20b6o13b4o$2b4o10b10o10b8o11b
4o14b4o22b8o13b8o21b4o16b4o20b10o10b6o13b3o2b3o$2b4o12b6o14b4o13b4o14b
4o23b6o15b6o20b8o12b8o20b6o13b4o16b4o$8o8b10o10b8o9b8o10b8o20b8o13b8o
19b8o12b8o18b10o10b6o13b8o$2b4o12b6o14b4o13b4o14b4o22b8o13b8o18b10o10b
10o19b6o12b6o15b4o$b6o10b8o12b6o11b6o12b6o20b10o11b10o18b8o12b8o18b10o
8b10o12b6o$2b4o12b6o14b4o13b4o14b4o22b8o13b8o17b12o8b12o18b6o12b6o15b
4o$b6o10b8o12b6o11b6o12b6o20b10o11b10o18b8o12b8o18b10o8b10o9b12o$2b4o
12b6o14b4o13b4o14b4o22b8o13b8o17b12o8b12o18b6o12b6o15b4o$b6o11b6o13b6o
11b6o12b6o19b12o9b12o17b8o12b8o18b10o8b10o10b10o$2b4o13b4o15b4o13b4o
14b4o22b8o13b8o20b6o14b6o21b6o12b6o16b2o$b6o11b6o13b6o11b6o12b6o19b12o
9b12o18b6o14b6o19b10o8b10o11b2o4b2o$2b4o13b4o15b4o13b4o14b4o22b8o13b8o
21b4o16b4o22b6o12b6o16b2o$b6o11b6o13b6o11b6o12b6o20b10o11b10o20b4o16b
4o21bob4obo10bob4obo12bo6bo$2b4o13b4o15b4o13b4o14b4o22b8o13b8o22b2o18b
2o24b4o14b4o16bo2bo$b6o11b6o13b6o11b6o12b6o20b10o11b10o19b6o14b6o59bo
4bo$2b4o13b4o15b4o13b4o14b4o23b6o15b6o23b2o18b2o63b2o$8o9b8o11b8o9b8o
10b8o20b8o13b8o21b4o16b4o$2b4o13b4o15b4o13b4o14b4o24b4o17b4o23b4o16b4o
$8o9b8o11b8o9b8o10b8o20b8o13b8o19b8o12b8o19b8o10b8o12b8o$2b4o13b4o15b
4o13b4o14b4o24b4o17b4o23b4o16b4o23b4o14b4o16b4o$b6o11b6o13b6o11b6o12b
6o22b6o15b6o21b6o14b6o21b6o12b6o14b6o$2b4o13b4o15b4o13b4o14b4o24b4o17b
4o23b4o16b4o23b4o14b4o16b4o$b6o11b6o13b6o11b6o12b6o22b6o15b6o21b6o14b
6o21b6o12b6o14b6o$2b4o13b4o15b4o13b4o14b4o24b4o17b4o23b4o16b4o23b4o14b
4o16b4o$8o9b8o11b8o9b8o10b8o20b8o13b8o19b8o12b8o19b8o10b8o12b8o$2b4o
13b4o15b4o13b4o14b4o24b4o17b4o23b4o16b4o23b4o14b4o16b4o$b6o11b6o13b6o
11b6o12b6o22b6o15b6o21b6o14b6o21b6o12b6o14b6o$b6o11b6o13b6o11b6o12b6o
22b6o15b6o21b6o14b6o21b6o12b6o14b6o$b6o11b6o13b6o11b6o12b6o22b6o15b6o
21b6o14b6o21b6o12b6o14b6o$b6o11b6o13b6o11b6o12b6o22b6o15b6o21b6o14b6o
21b6o12b6o14b6o$bo4bo11bo4bo13bo4bo11bo4bo12bo4bo22bo4bo15bo4bo21bo4bo
14bo4bo21bo4bo12bo4bo14bo4bo28$222b2o18b2o$222b2o18b2o$20b4o37b2o66b2o
89b6o15b4o$20b4o37b2o66b2o89b6o15b4o$18b8o16b2o15b6o44b2o17b4o70b2o15b
8o12b8o$19b6o17b2o16b4o45b2o17b4o70b2o16b6o13b8o$3b2o13b8o15b4o14b6o
42b6o13b8o23b4o18b4o18b4o15b6o14b6o$3b2o14b6o16b4o15b4o43b6o13b8o23b4o
18b4o18b4o15bob2obo14bob2obo$b6o10b10o12b8o11b8o39b10o11b8o21b8o14b8o
14b8o14b4o15b6o$2b4o13b6o15b6o14b4o41b10o11b3o2b3o22b6o15b8o16b4o13b3o
4b3o11bo6bo$8o10b8o12b10o11b6o43bo2bo43b8o14b8o15b6o13b8o13b6o$2b4o13b
6o15b6o14b4o42b3o2b3o13b2o2b2o24b4o17bob2obo35b3o2b3o11b4o2b4o$8o10b8o
12b10o11b6o92b4o17b6o15b3o2b3o11b10o10b10o$2b4o13b6o15b6o14b4o42bobo2b
obo13bob2obo22bo6bo13b2o6b2o34b2o2b2o14b2o2b2o$8o10b8o12b10o11b6o43b4o
15b6o23b6o15b8o13b4o2b4o10b10o10b10o$2b4o14b4o16b6o13b6o23b4o14b8o14b
4o22b4o2b4o13b3o2b3o15bo4bo14b2o2b2o14b2o2b2o$2b4o14b4o14b10o9b10o21b
4o16b4o16b4o22b10o12b10o12b10o11b8o12b8o$3b2o16b2o17b6o13b6o21b8o12b8o
12b8o21b3o2b3o14b3o2b3o14b3o2b3o13b2o2b2o14b2o2b2o$2b4o14b4o14b10o9b
10o19b8o12b8o12b8o20b10o12b10o12b10o11b8o12b8o$3b2o16b2o17b6o13b6o20b
10o10b10o10b10o20b3o2b3o14b3o2b3o14b3o2b3o13b2o2b2o14b2o2b2o$2b4o14b4o
14b10o9b10o19b8o12b8o12b8o19b12o10b12o10b12o10b8o12b8o$3b2o16b2o17b6o
13b6o19b12o8b12o8b12o19b3o2b3o14b3o2b3o14b3o2b3o12b3o2b3o12b3o2b3o$2b
4o14b4o14b10o9b10o19b8o12b8o12b8o20b10o12b10o12b10o10b10o10b10o$3b2o
16b2o17b6o13b6o19b12o8b12o8b12o19b3o2b3o14b3o2b3o14b3o2b3o12b3o2b3o12b
3o2b3o$b6o12b6o14b8o11b8o20b8o12b8o12b8o20b10o12b10o12b10o10b10o10b10o
$3b2o16b2o17b6o13b6o20b10o10b10o10b10o20b3o2b3o14b3o2b3o14b3o2b3o12b3o
2b3o12b3o2b3o$b6o12b6o15b6o13b6o22b6o14b6o14b6o21b10o12b10o12b10o10b
10o10b10o$3b2o16b2o19b2o17b2o25b4o16b4o16b4o23b3o2b3o14b3o2b3o14b3o2b
3o12b3o2b3o12b3o2b3o$b6o12b6o15b6o13b6o22b6o14b6o14b6o20b12o10b12o10b
12o8b12o8b12o$3b2o16b2o19b2o17b2o25b4o16b4o16b4o23b3o2b3o14b3o2b3o14b
3o2b3o12b3o2b3o12b3o2b3o$b6o12b6o15b6o13b6o22b6o14b6o14b6o21b10o12b10o
12b10o10b10o10b10o$3b2o16b2o19b2o17b2o26b2o18b2o18b2o24b3o2b3o14b3o2b
3o14b3o2b3o12b3o2b3o12b3o2b3o$b6o12b6o15b6o13b6o22b6o14b6o14b6o21b10o
12b10o12b10o10b10o10b10o$3b2o16b2o19b2o17b2o26b2o18b2o18b2o25bo4bo16bo
4bo16bo4bo14bo4bo14bo4bo$2b4o14b4o17b4o15b4o24b4o16b4o16b4o23b8o14b8o
14b8o12b8o12b8o$3b2o16b2o19b2o17b2o26b2o18b2o18b2o$2b4o14b4o17b4o15b4o
24b4o16b4o16b4o25b4o18b4o18b4o16b4o16b4o$2b4o14b4o17b4o15b4o24b4o16b4o
16b4o25b4o18b4o18b4o16b4o16b4o$b6o12b6o15b6o13b6o22b6o14b6o14b6o23b6o
16b6o16b6o14b6o14b6o$b6o12b6o15b6o13b6o22b6o14b6o14b6o23b6o16b6o16b6o
14b6o14b6o$b6o12b6o15b6o13b6o22b6o14b6o14b6o23b6o16b6o16b6o14b6o14b6o$
b6o12b6o15b6o13b6o22b6o14b6o14b6o23b6o16b6o16b6o14b6o14b6o$bo4bo12bo4b
o15bo4bo13bo4bo22bo4bo14bo4bo14bo4bo23bo4bo16bo4bo16bo4bo14bo4bo14bo4b
o!

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

Re: Spaceships in Life-like cellular automata

Post by LaundryPizza03 » April 10th, 2020, 8:58 am

For rules with B0, we can treat them as alternating rules and mix and match these categories to get rules where spaceships cannot exist:
  1. Rules where patterns cannot shrink (B1, B/S01234, B2/S0123, B3/S0123, B23/S0)
  2. Rules where connected patterns cannot shrink (B/S123456, B34/S12345, B345/S1234, S234567/A2)
This yields the following rulespaces:
  1. Rules with B0/S7 without B1
  2. Rules with B045678 without B1 and rules with B0/S7 without S01234
  3. Rules with B05678/S6 without B1 and rules with B0/S7 without B2/S0123
  4. Rules with B05678/S5 without B1 and rules with B0/S7 without B3/S0123
  5. Rules with B08/S56 without B1 and rules with B0/S7 without B23/S0
  6. Rules with B045678 without S01234
  7. Rules with B05678/S6 without S01234 and rules with B045678 without B2/S0123
  8. Rules with B05678/S5 without S01234 and rules with B045678 without B3/S0123
  9. Rules with B08/S56 without S01234 and rules with B045678 without B23/S0
  10. Rules with B05678/S6 without B2/S0123
  11. Rules with B05678/S6 without B3/S0123 and rules with B05678/S5 without B2/S0123
  12. Rules with B05678/S6 without B23/S0 and rules with B08/S56 without B2/S0123
  13. Rules with B05678/S5 without B3/S0123
  14. Rules with B05678/S5 without B23/S0 and rules with B08/S56 without B3/S0123
  15. Rules with B08/S56 without B23/S0
  16. Rules with B0234567 without S123456
Also:
  • With B0/S6 and without B1 or B2, or with B0/S67 without B2, all patterns expand at (2,1)c/2.
  • With B0123 and without any of S567, patterns can never leave their bounding box.

Code: Select all

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

Naszvadi
Posts: 1244
Joined: May 7th, 2016, 8:53 am
Contact:

Re: Spaceships in Life-like cellular automata

Post by Naszvadi » April 12th, 2020, 10:38 am

Naszvadi wrote:
April 8th, 2020, 1:55 pm
Saka wrote:
April 8th, 2020, 11:03 am
I think this fits here.
2 c/7o ships in Diamoeba. They might be known, but I'm not sure

Code: Select all

x = 28, y = 30, rule = B35678/S5678
16bo$16b6o$2bobo9bob8o$b4o3bo5b10o$2b5obobob14o$26o$26o$2b5obobob14o$b
4o3bo5b10o$2bobo9bob8o$16b6o$16bo7$21bobo$17bobobobo$2bobo12b9o$b4o3bo
5bob10o$2b5obobobob14o$28o$28o$2b5obobobob14o$b4o3bo5bob10o$2bobo12b9o
$17bobobobo$21bobo!
They remind me of Lacrymaria.
The bigger one had been discovered by David Eppstein, source: http://entropymine.com/jason/life/alt/diamoeba-c7.lif

Bottom line, 5th from left:

Code: Select all

#CDiamoeba c/7 spaceships
#CFound by David Eppstein, 11-Mar-1999 - 24-Mar-1999
x = 249, y = 114, rule = B35678/S5678
74b2o$74b2o47b2o45b2o$38b4o13b4o14b4o46b2o45b2o$38b4o13b4o14b4o45b4o
42b6o41b2o$37b6o10b8o10b8o43b4o42b6o41b2o18b2o$37b6o10b8o10b8o22b4o15b
8o38b10o21b2o14b6o16b2o$35b10o8b8o10b8o22b4o17b4o40b10o21b2o15b4o15b6o
$20b2o13b10o7b10o9b3o2b3o20b8o14b6o42bo2bo23b4o13b6o14b6o$20b2o16bo2bo
58b6o16b4o41b3o2b3o21b4o14b4o13b10o$18b6o14bo2bo11b3o2b3o11b2o2b2o20b
10o12b8o66b8o10b8o12b8o$18b6o31bo2bo41b6o16b4o41bobo2bobo20b6o13b4o15b
6o$17b8o12b6o11bob2obo12bob2obo21b8o14b6o42b4o20b10o10b6o12b4o2b4o$18b
6o14b4o12bob2obo12b6o22b6o16b4o23b4o14b8o20b6o13b4o$2b4o10b10o10b8o11b
4o14b4o22b8o13b8o21b4o16b4o20b10o10b6o13b3o2b3o$2b4o12b6o14b4o13b4o14b
4o23b6o15b6o20b8o12b8o20b6o13b4o16b4o$8o8b10o10b8o9b8o10b8o20b8o13b8o
19b8o12b8o18b10o10b6o13b8o$2b4o12b6o14b4o13b4o14b4o22b8o13b8o18b10o10b
10o19b6o12b6o15b4o$b6o10b8o12b6o11b6o12b6o20b10o11b10o18b8o12b8o18b10o
8b10o12b6o$2b4o12b6o14b4o13b4o14b4o22b8o13b8o17b12o8b12o18b6o12b6o15b
4o$b6o10b8o12b6o11b6o12b6o20b10o11b10o18b8o12b8o18b10o8b10o9b12o$2b4o
12b6o14b4o13b4o14b4o22b8o13b8o17b12o8b12o18b6o12b6o15b4o$b6o11b6o13b6o
11b6o12b6o19b12o9b12o17b8o12b8o18b10o8b10o10b10o$2b4o13b4o15b4o13b4o
14b4o22b8o13b8o20b6o14b6o21b6o12b6o16b2o$b6o11b6o13b6o11b6o12b6o19b12o
9b12o18b6o14b6o19b10o8b10o11b2o4b2o$2b4o13b4o15b4o13b4o14b4o22b8o13b8o
21b4o16b4o22b6o12b6o16b2o$b6o11b6o13b6o11b6o12b6o20b10o11b10o20b4o16b
4o21bob4obo10bob4obo12bo6bo$2b4o13b4o15b4o13b4o14b4o22b8o13b8o22b2o18b
2o24b4o14b4o16bo2bo$b6o11b6o13b6o11b6o12b6o20b10o11b10o19b6o14b6o59bo
4bo$2b4o13b4o15b4o13b4o14b4o23b6o15b6o23b2o18b2o63b2o$8o9b8o11b8o9b8o
10b8o20b8o13b8o21b4o16b4o$2b4o13b4o15b4o13b4o14b4o24b4o17b4o23b4o16b4o
$8o9b8o11b8o9b8o10b8o20b8o13b8o19b8o12b8o19b8o10b8o12b8o$2b4o13b4o15b
4o13b4o14b4o24b4o17b4o23b4o16b4o23b4o14b4o16b4o$b6o11b6o13b6o11b6o12b
6o22b6o15b6o21b6o14b6o21b6o12b6o14b6o$2b4o13b4o15b4o13b4o14b4o24b4o17b
4o23b4o16b4o23b4o14b4o16b4o$b6o11b6o13b6o11b6o12b6o22b6o15b6o21b6o14b
6o21b6o12b6o14b6o$2b4o13b4o15b4o13b4o14b4o24b4o17b4o23b4o16b4o23b4o14b
4o16b4o$8o9b8o11b8o9b8o10b8o20b8o13b8o19b8o12b8o19b8o10b8o12b8o$2b4o
13b4o15b4o13b4o14b4o24b4o17b4o23b4o16b4o23b4o14b4o16b4o$b6o11b6o13b6o
11b6o12b6o22b6o15b6o21b6o14b6o21b6o12b6o14b6o$b6o11b6o13b6o11b6o12b6o
22b6o15b6o21b6o14b6o21b6o12b6o14b6o$b6o11b6o13b6o11b6o12b6o22b6o15b6o
21b6o14b6o21b6o12b6o14b6o$b6o11b6o13b6o11b6o12b6o22b6o15b6o21b6o14b6o
21b6o12b6o14b6o$bo4bo11bo4bo13bo4bo11bo4bo12bo4bo22bo4bo15bo4bo21bo4bo
14bo4bo21bo4bo12bo4bo14bo4bo28$222b2o18b2o$222b2o18b2o$20b4o37b2o66b2o
89b6o15b4o$20b4o37b2o66b2o89b6o15b4o$18b8o16b2o15b6o44b2o17b4o70b2o15b
8o12b8o$19b6o17b2o16b4o45b2o17b4o70b2o16b6o13b8o$3b2o13b8o15b4o14b6o
42b6o13b8o23b4o18b4o18b4o15b6o14b6o$3b2o14b6o16b4o15b4o43b6o13b8o23b4o
18b4o18b4o15bob2obo14bob2obo$b6o10b10o12b8o11b8o39b10o11b8o21b8o14b8o
14b8o14b4o15b6o$2b4o13b6o15b6o14b4o41b10o11b3o2b3o22b6o15b8o16b4o13b3o
4b3o11bo6bo$8o10b8o12b10o11b6o43bo2bo43b8o14b8o15b6o13b8o13b6o$2b4o13b
6o15b6o14b4o42b3o2b3o13b2o2b2o24b4o17bob2obo35b3o2b3o11b4o2b4o$8o10b8o
12b10o11b6o92b4o17b6o15b3o2b3o11b10o10b10o$2b4o13b6o15b6o14b4o42bobo2b
obo13bob2obo22bo6bo13b2o6b2o34b2o2b2o14b2o2b2o$8o10b8o12b10o11b6o43b4o
15b6o23b6o15b8o13b4o2b4o10b10o10b10o$2b4o14b4o16b6o13b6o23b4o14b8o14b
4o22b4o2b4o13b3o2b3o15bo4bo14b2o2b2o14b2o2b2o$2b4o14b4o14b10o9b10o21b
4o16b4o16b4o22b10o12b10o12b10o11b8o12b8o$3b2o16b2o17b6o13b6o21b8o12b8o
12b8o21b3o2b3o14b3o2b3o14b3o2b3o13b2o2b2o14b2o2b2o$2b4o14b4o14b10o9b
10o19b8o12b8o12b8o20b10o12b10o12b10o11b8o12b8o$3b2o16b2o17b6o13b6o20b
10o10b10o10b10o20b3o2b3o14b3o2b3o14b3o2b3o13b2o2b2o14b2o2b2o$2b4o14b4o
14b10o9b10o19b8o12b8o12b8o19b12o10b12o10b12o10b8o12b8o$3b2o16b2o17b6o
13b6o19b12o8b12o8b12o19b3o2b3o14b3o2b3o14b3o2b3o12b3o2b3o12b3o2b3o$2b
4o14b4o14b10o9b10o19b8o12b8o12b8o20b10o12b10o12b10o10b10o10b10o$3b2o
16b2o17b6o13b6o19b12o8b12o8b12o19b3o2b3o14b3o2b3o14b3o2b3o12b3o2b3o12b
3o2b3o$b6o12b6o14b8o11b8o20b8o12b8o12b8o20b10o12b10o12b10o10b10o10b10o
$3b2o16b2o17b6o13b6o20b10o10b10o10b10o20b3o2b3o14b3o2b3o14b3o2b3o12b3o
2b3o12b3o2b3o$b6o12b6o15b6o13b6o22b6o14b6o14b6o21b10o12b10o12b10o10b
10o10b10o$3b2o16b2o19b2o17b2o25b4o16b4o16b4o23b3o2b3o14b3o2b3o14b3o2b
3o12b3o2b3o12b3o2b3o$b6o12b6o15b6o13b6o22b6o14b6o14b6o20b12o10b12o10b
12o8b12o8b12o$3b2o16b2o19b2o17b2o25b4o16b4o16b4o23b3o2b3o14b3o2b3o14b
3o2b3o12b3o2b3o12b3o2b3o$b6o12b6o15b6o13b6o22b6o14b6o14b6o21b10o12b10o
12b10o10b10o10b10o$3b2o16b2o19b2o17b2o26b2o18b2o18b2o24b3o2b3o14b3o2b
3o14b3o2b3o12b3o2b3o12b3o2b3o$b6o12b6o15b6o13b6o22b6o14b6o14b6o21b10o
12b10o12b10o10b10o10b10o$3b2o16b2o19b2o17b2o26b2o18b2o18b2o25bo4bo16bo
4bo16bo4bo14bo4bo14bo4bo$2b4o14b4o17b4o15b4o24b4o16b4o16b4o23b8o14b8o
14b8o12b8o12b8o$3b2o16b2o19b2o17b2o26b2o18b2o18b2o$2b4o14b4o17b4o15b4o
24b4o16b4o16b4o25b4o18b4o18b4o16b4o16b4o$2b4o14b4o17b4o15b4o24b4o16b4o
16b4o25b4o18b4o18b4o16b4o16b4o$b6o12b6o15b6o13b6o22b6o14b6o14b6o23b6o
16b6o16b6o14b6o14b6o$b6o12b6o15b6o13b6o22b6o14b6o14b6o23b6o16b6o16b6o
14b6o14b6o$b6o12b6o15b6o13b6o22b6o14b6o14b6o23b6o16b6o16b6o14b6o14b6o$
b6o12b6o15b6o13b6o22b6o14b6o14b6o23b6o16b6o16b6o14b6o14b6o$bo4bo12bo4b
o15bo4bo13bo4bo22bo4bo14bo4bo14bo4bo23bo4bo16bo4bo16bo4bo14bo4bo14bo4b
o!
The smaller one is listed here (2014 or earlier) by glider_rider:
../forums/viewtopic.php?p=15075#p15075

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

Re: Spaceships in Life-like cellular automata

Post by LaundryPizza03 » April 17th, 2020, 11:29 pm

This latest batch includes a number of c/2 orthogonal ships in the vincinity of B3/S0125 — a rulespace apparently not explored by Eppstein. Example finding:

Code: Select all

x = 17, y = 24, rule = B3578/S0125
2b4o5b4o$2b4o5b4o$b6o3b6o$bo4bo3bo4bo$3o2b3ob3o2b3o$bo4bo3bo4bo2$obob
3o3b3obobo$2bob2obobob2obo$b2o2b3ob3o2b2o$bob2o2bobo2b2obo2$2bo2b3ob3o
2bo$4bob2ob2obo$3bo2b2ob2o2bo$bo5bobo5bo$bo13bo$obobobo3bobobobo$5bo2b
o2bo$2bo4b3o4bo$3bobo5bobo2$2bobobo3bobobo$4bo7bo!
new-gliders.db.txt
(3.85 MiB) Downloaded 161 times
oscillators.db.txt
(90.01 KiB) Downloaded 153 times

Code: Select all

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

User avatar
Saka
Posts: 3627
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: Spaceships in Life-like cellular automata

Post by Saka » April 18th, 2020, 2:15 am

Odd-symmetric c/7o in Diamoeba. I think this is new.

Code: Select all

x = 15, y = 23, rule = B35678/S5678
2bobo$b4o3bo$2b5obobobo$13o$15o$2b11o$b6o2bo2bo$2bobo4bo$4bo$4bo6b2o$
4bobo3b3o$obobobobob5o$4bobo3b3o$4bo6b2o$4bo$2bobo4bo$b6o2bo2bo$2b11o$
15o$13o$2b5obobobo$b4o3bo$2bobo!
The front spark can delete various things

Code: Select all

x = 88, y = 23, rule = B35678/S5678
10bobo$6bo3b4o$2bobobob5o$2b13o$15o$2b11o$2bo2bo2b6o40bobo$5bo4bobo39b
obobobobo11bobobobobobobobo$10bo43b8o12b11o$2b2o6bo23b3o15b8o11b17o$2b
3o3bobo17bo7bo17b7o12b13o$5obobobobobo11bobo5bobo5b4o6b8o11bobobobobob
obobobo$2b3o3bobo15bobo13b4o8b8o11bo11bo$2b2o6bo17bo23bobobobobo$10bo
43bobo$5bo4bobo$2bo2bo2b6o$2b11o$15o$2b13o$2bobobob5o$6bo3b4o$10bobo!

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

Re: Spaceships in Life-like cellular automata

Post by LaundryPizza03 » April 18th, 2020, 5:16 am

Saka wrote:
April 18th, 2020, 2:15 am
Odd-symmetric c/7o in Diamoeba. I think this is new.

Code: Select all

x = 15, y = 23, rule = B35678/S5678
2bobo$b4o3bo$2b5obobobo$13o$15o$2b11o$b6o2bo2bo$2bobo4bo$4bo$4bo6b2o$
4bobo3b3o$obobobobob5o$4bobo3b3o$4bo6b2o$4bo$2bobo4bo$b6o2bo2bo$2b11o$
15o$13o$2b5obobobo$b4o3bo$2bobo!
The front spark can delete various things

Code: Select all

x = 88, y = 23, rule = B35678/S5678
10bobo$6bo3b4o$2bobobob5o$2b13o$15o$2b11o$2bo2bo2b6o40bobo$5bo4bobo39b
obobobobo11bobobobobobobobo$10bo43b8o12b11o$2b2o6bo23b3o15b8o11b17o$2b
3o3bobo17bo7bo17b7o12b13o$5obobobobobo11bobo5bobo5b4o6b8o11bobobobobob
obobobo$2b3o3bobo15bobo13b4o8b8o11bo11bo$2b2o6bo17bo23bobobobobo$10bo
43bobo$5bo4bobo$2bo2bo2b6o$2b11o$15o$2b13o$2bobobob5o$6bo3b4o$10bobo!
That technically doesn't count as new for the database, but I'll include it anyway because it's interesting enough. (This is the first ship with a front spark.)

Code: Select all

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

User avatar
Saka
Posts: 3627
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: Spaceships in Life-like cellular automata

Post by Saka » April 18th, 2020, 5:30 am

LaundryPizza03 wrote:
April 18th, 2020, 5:16 am
That technically doesn't count as new for the database, but I'll include it anyway because it's interesting enough. (This is the first ship with a front spark.)
What counts as "new for the database"? A new speed / period, I assume?
Apologies for being too lazy to do a simple search...

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

Re: Spaceships in Life-like cellular automata

Post by LaundryPizza03 » April 18th, 2020, 8:04 am

Saka wrote:
April 18th, 2020, 5:30 am
LaundryPizza03 wrote:
April 18th, 2020, 5:16 am
That technically doesn't count as new for the database, but I'll include it anyway because it's interesting enough. (This is the first ship with a front spark.)
What counts as "new for the database"? A new speed / period, I assume?
Apologies for being too lazy to do a simple search...
See OP for explanation.

Code: Select all

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

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

Re: Spaceships in Life-like cellular automata

Post by LaundryPizza03 » April 29th, 2020, 7:36 am

One of the ships in the original gliders.db is actually 3 ships:

Code: Select all

x = 170, y = 307, rule = B345678/S028
4b4o4b4o$8bo2bo$4bo10bo$5bobo4bobo$6bobo2bobo$5bobob2obobo$5b2obo2bob
2o$5bo3b2o3bo$5bo2b4o2bo$8bo2bo$5b2ob4ob2o2$7b2o2b2o$4b2obo4bob2o$2bo
6b2o6bo$4b3o6b3o$7b6o$4bo3bo2bo3bo$5bo8bo$7bo4bo$6bobo2bobo$7bob2obo$
8bo2bo$6bo2b2o2bo$5b4o2b4o$4b4ob2ob4o$4b3obo2bob3o$4bo2bob2obo2bo$4bob
3o2b3obo2$5b3ob2ob3o$7b2o2b2o$6b8o$6b3o2b3o$6b8o$2b5o6b5o$5b10o$4b3o6b
3o$7bob2obo2$6b2o4b2o$6b2ob2ob2o$8bo2bo$7bob2obo$5bob2o2b2obo$4bo4b2o
4bo$8bo2bo$3bo3bob2obo3bo$3bob2obo2bob2obo$5b2o2b2o2b2o$5b10o$8b4o$5bo
3b2o3bo$5bo8bo$3bobobob2obobobo$4b2o8b2o$7b6o$5bo2bo2bo2bo$6bobo2bobo$
9b2o$5bo2bo2bo2bo$4bo2bob2obo2bo$6bobo2bobo$3bo2b2ob2ob2o2bo$8bo2bo$bo
2b2o2b4o2b2o2bo$2bo14bo$b5o3b2o3b5o$b2o2b2obo2bob2o2b2o$9o2b9o$5b2o6b
2o$2b4ob6ob4o$2bo14bo136b4o4b4o$3bob2o2b2o2b2obo141bo2bo$3bo2bo2b2o2bo
2bo137bo10bo$4b2ob2o2b2ob2o139bobo4bobo$3bo4b4o4bo139bobo2bobo$3b6o2b
6o138bobob2obobo$3b5o4b5o138b2obo2bob2o$4bob2ob2ob2obo139bo3b2o3bo$4bo
b2o4b2obo139bo2b4o2bo$2bob5o2b5obo140bo2bo$b2o3b2o4b2o3b2o136b2ob4ob2o
$bobo5b2o5bobo$2bobo2bo4bo2bobo139b2o2b2o$b5o3b2o3b5o135b2obo4bob2o$b
4ob2o4b2ob4o133bo6b2o6bo$bobobob6obobobo135b3o6b3o$2bo3b2o4b2o3bo139b
6o$bo2bo4b2o4bo2bo135bo3bo2bo3bo$2b3ob2o4b2ob3o137bo8bo$3b3o2b4o2b3o
140bo4bo$2bo2b2o6b2o2bo138bobo2bobo$5bo3b2o3bo142bob2obo$6b2o4b2o144bo
2bo$2bo3bob4obo3bo138bo2b2o2bo$3b2o3bo2bo3b2o138b4o2b4o$2bo14bo136b4ob
2ob4o$o2bob10obo2bo134b3obo2bob3o$6bo6bo140bo2bob2obo2bo$bo6bo2bo6bo
135bob3o2b3obo$3bob2o6b2obo$8b4o143b3ob2ob3o$4bobobo2bobobo141b2o2b2o$
6b8o142b8o$5bo2b4o2bo141b3o2b3o$7b6o143b8o$152b5o6b5o$4b12o139b10o$4b
2o8b2o138b3o6b3o$8b4o145bob2obo$5b2ob4ob2o$5bo8bo141b2o4b2o$5bo3b2o3bo
141b2ob2ob2o$4bo3b4o3bo142bo2bo$9b2o146bob2obo$3bo2b8o2bo138bob2o2b2ob
o$2bob3ob4ob3obo35b2o10b2o39b2o2b2o42bo4b2o4bo$5bo2b4o2bo36bo2bo10bo2b
o37bo4bo46bo2bo$4b4o4b4o37b2o10b2o35bob10obo37bo3bob2obo3bo$6bo2b2o2bo
37b3o12b3o34bob3o2b3obo38bob2obo2bob2obo$5b10o38b2o10b2o36b2obo4bob2o
40b2o2b2o2b2o$8b4o44b2ob2ob2o40b2o6b2o41b10o$2bob2o8b2obo85b5o2b5o43b
4o$3bo4bo2bo4bo35b2o5b2o5b2o87bo3b2o3bo$2bob4o4b4obo36b3ob4ob3o42b2o
45bo8bo$3b3o2b4o2b3o38bo3b2o3bo42bo2bo42bobobob2obobobo$2b3o10b3o33b
18o38bo2bo43b2o8b2o$bo5b6o5bo34b2o2bo4bo2b2o36b5o2b5o42b6o$bo2b2o2bo2b
o2b2o2bo34b2o2bob2obo2b2o36bob2ob2ob2obo40bo2bo2bo2bo$8bo2bo42b2ob6ob
2o37b2o2bo2bo2b2o41bobo2bobo$2bobobo2b2o2bobobo36b4ob2ob4o42b2o49b2o$
4b3o6b3o37bo3b6o3bo38bobo2bobo42bo2bo2bo2bo$bobo2b8o2bobo34b3o8b3o38b
2ob2ob2o41bo2bob2obo2bo$2b2o2b3o2b3o2b2o41b2o44b3o2b3o43bobo2bobo$7bo
4bo41b3ob4ob3o37b2o3b2o3b2o38bo2b2ob2ob2o2bo$3b14o42b2o39b2ob2o2bo2bo
2b2ob2o40bo2bo$2bo2b2o6b2o2bo36bob8obo34b5ob6ob5o33bo2b2o2b4o2b2o2bo$
6bo6bo40bo2bo4bo2bo38bo2b4o2bo38bo14bo$4b12o41b2o2b2o38bo4b6o4bo34b5o
3b2o3b5o$6o8b6o33b3o2b4o2b3o33bob4o2b2o2b4obo33b2o2b2obo2bob2o2b2o$o3b
2ob6ob2o3bo36b8o40bo2b4o2bo36b9o2b9o$3b4o6b4o35bob2o2b4o2b2obo35b3o6b
3o40b2o6b2o$bo2b12o2bo33bo3b2o4b2o3bo32b7ob2ob7o34b4ob6ob4o$2bobo10bob
o37bo8bo36b2obob2o2b2obob2o35bo14bo$2bo3bob4obo3bo35bo4bo2bo4bo34b3o4b
2o4b3o36bob2o2b2o2b2obo$bo2bo10bo2bo35bo4b2o4bo36bo2bobo2bobo2bo37bo2b
o2b2o2bo2bo$b3obob2o2b2obob3o37b2o4b2o36bob3obob2obob3obo36b2ob2o2b2ob
2o$6b8o42b8o21bo17b3obo2bob3o20bo17bo4b4o4bo$o2bobobo4bobobo2bo10b2ob
2ob2ob2o15bo2b2o2bo21bo14b2ob2obob2obob2ob2o17bo17b6o2b6o$4b4ob2ob4o
41b6o39bo2bobo2bobo2bo37b5o4b5o$2b4ob6ob4o67bo14b3o2b2ob2ob2o2b3o17bo
18bob2ob2ob2obo$3b2ob3o2b3ob2o68bo14bo6bo2bo6bo17bo18bob2o4b2obo$2bobo
4b2o4bobo39b6o17b2ob2ob2ob2o9b2o3b2ob2ob2o3b2o12b2ob2ob2ob2o11bob5o2b
5obo$2b4o2b4o2b4o38bob4obo21bo16b6o2b6o19bo15b2o3b2o4b2o3b2o$4b2ob6ob
2o43b2o24bo49bo15bobo5b2o5bobo$bo2bo10bo2bo11b2ob2ob2ob2o12b2o10b2o36b
2o3b2o3b2o37bobo2bo4bo2bobo$4b2ob6ob2o37bo2b8o2bo18bo21bo2bo24bo15b5o
3b2o3b5o$b2obo10bob2o33b4ob6ob4o17bo21b4o24bo15b4ob2o4b2ob4o$4bo2b6o2b
o34bo2b2ob8ob2o2bo33b2o8b2o36bobobob6obobobo$bo3bobo4bobo3bo32b5o8b5o
32bo6b2o6bo35bo3b2o4b2o3bo$2bo3bo6bo3bo38bo6bo38b5ob2ob5o35bo2bo4b2o4b
o2bo$ob3o10b3obo32b2ob10ob2o37b3o2b3o39b3ob2o4b2ob3o$9b2o41bobo10bobo
34b2ob8ob2o37b3o2b4o2b3o$9b2o42bo3b6o3bo37bo2bo2bo2bo38bo2b2o6b2o2bo$
6b8o38bob2ob6ob2obo34b4obo2bob4o39bo3b2o3bo$3bo12bo36b2o10b2o33bobo5b
2o5bobo38b2o4b2o$5b2o2b2o2b2o38b14o35bo2b3o2b3o2bo36bo3bob4obo3bo$4bob
ob4obobo84b2o4bob2obo4b2o35b2o3bo2bo3b2o$5bob6obo38b2o2b6o2b2o33b2o3b
3o2b3o3b2o34bo14bo$9b2o42b2o10b2o33b5ob6ob5o32bo2bob10obo2bo$4b2o2b4o
2b2o35b4o2b6o2b4o33b6o2b6o40bo6bo$8bo2bo41b14o34b3obo6bob3o34bo6bo2bo
6bo$9b2o44b2ob4ob2o36b2o2b2ob2ob2o2b2o36bob2o6b2obo$9b2o42bob2obo2bob
2obo33b2o2b3o4b3o2b2o40b4o$4bob2ob2ob2obo39b3ob2ob3o35bo4b3o2b3o4bo36b
obobo2bobobo$4b2o2bo2bo2b2o36bobo3bo2bo3bobo33b2o3bo4bo3b2o39b8o$9b2o
41bo2bo2b4o2bo2bo37b3o2b3o42bo2b4o2bo$5bo2bo2bo2bo36bo2b3obo2bob3o2bo
32bo3bo2b2o2bo3bo40b6o$4bo2bob2obo2bo37b3o2bo2bo2b3o35b4o2b2o2b4o$7b2o
2b2o37bob3o4b2o4b3obo84b12o$5bo3b2o3bo35bo4bo8bo4bo34bob6obo40b2o8b2o$
2bo2bo2bo2bo2bo2bo33bo2bob8obo2bo39b2o48b4o$bo2bo3b4o3bo2bo34bobob6obo
bo39bob2obo43b2ob4ob2o$bo3bo8bo3bo33bobo3b4o3bobo87bo8bo$2b3o2b6o2b3o
34bo2b10o2bo39b4o44bo3b2o3bo$3b2o10b2o35bo3b2o4b2o3bo86bo3b4o3bo$bo5b
6o5bo34b3ob2o2b2ob3o40bo2bo48b2o$4b4o4b4o40bobo2bobo43b4o42bo2b8o2bo$b
o5b6o5bo37b3o2b3o44b2o42bob3ob4ob3obo$bo3bo2bo2bo2bo3bo136bo2b4o2bo$2b
3obo2b2o2bob3o136b4o4b4o$5b4o2b4o141bo2b2o2bo$3b3obob2obob3o138b10o$2b
o3bobo2bobo3bo140b4o$b3obobob2obobob3o133bob2o8b2obo$o2bo2bobo2bobo2bo
2bo133bo4bo2bo4bo$4b2obob2obob2o136bob4o4b4obo$bo2b2o2bo2bo2b2o2bo134b
3o2b4o2b3o$b7ob2ob7o133b3o10b3o$3b3o2bo2bo2b3o134bo5b6o5bo$2bo6b2o6bo
133bo2b2o2bo2bo2b2o2bo$4b12o142bo2bo$6b3o2b3o138bobobo2b2o2bobobo$5b3o
4b3o139b3o6b3o$5b3o4b3o136bobo2b8o2bobo$6b8o138b2o2b3o2b3o2b2o$2bob5o
2b5obo139bo4bo$8bo2bo141b14o$3b4ob4ob4o135bo2b2o6b2o2bo$5bo8bo141bo6bo
$4bob3o2b3obo138b12o$2bo4bo4bo4bo132b6o8b6o$bo2b5o2b5o2bo131bo3b2ob6ob
2o3bo$o3b2o3b2o3b2o3bo133b4o6b4o$3b6o2b6o134bo2b12o2bo$ob4o3b2o3b4obo
132bobo10bobo$o5b3o2b3o5bo132bo3bob4obo3bo$3bobo8bobo134bo2bo10bo2bo$b
o3bobo4bobo3bo132b3obob2o2b2obob3o$2bob2o2bo2bo2b2obo138b8o$3b2obob4ob
ob2o133bo2bobobo4bobobo2bo$b5o3b2o3b5o135b4ob2ob4o$bo2b12o2bo133b4ob6o
b4o$2b4o3b2o3b4o135b2ob3o2b3ob2o$3b3ob2o2b2ob3o135bobo4b2o4bobo$7b2o2b
2o139b4o2b4o2b4o$4b12o138b2ob6ob2o$6b8o137bo2bo10bo2bo$6b8o140b2ob6ob
2o$8b4o139b2obo10bob2o$8b4o142bo2b6o2bo$151bo3bobo4bobo3bo$9b2o141bo3b
o6bo3bo$3b2o4b2o4b2o133bob3o10b3obo$bo2bo3bo2bo3bo2bo$3b2o4b2o4b2o$b3o
12b3o$3b2o10b2o$6b2ob2ob2o2$2b2o5b2o5b2o$4b3ob4ob3o$5bo3b2o3bo$b18o$3b
2o2bo4bo2b2o$3b2o2bob2obo2b2o$4b2ob6ob2o$4b4ob2ob4o$3bo3b6o3bo$3b3o8b
3o$9b2o$4b3ob4ob3o$9b2o$4bob8obo$4bo2bo4bo2bo$7b2o2b2o$3b3o2b4o2b3o$6b
8o$2bob2o2b4o2b2obo$2bo3b2o4b2o3bo$5bo8bo$3bo4bo2bo4bo$4bo4b2o4bo$6b2o
4b2o$6b8o$6bo2b2o2bo$7b6o3$7b6o$6bob4obo$9b2o$3b2o10b2o$3bo2b8o2bo$2b
4ob6ob4o$o2b2ob8ob2o2bo$b5o8b5o$6bo6bo$2b2ob10ob2o$2bobo10bobo$3bo3b6o
3bo$2bob2ob6ob2obo$3b2o10b2o$3b14o2$3b2o2b6o2b2o$3b2o10b2o$b4o2b6o2b4o
$3b14o$5b2ob4ob2o$3bob2obo2bob2obo$5b3ob2ob3o$2bobo3bo2bo3bobo$2bo2bo
2b4o2bo2bo$bo2b3obo2bob3o2bo$3b3o2bo2bo2b3o$ob3o4b2o4b3obo$o4bo8bo4bo$
bo2bob8obo2bo$3bobob6obobo$2bobo3b4o3bobo$2bo2b10o2bo$2bo3b2o4b2o3bo$
3b3ob2o2b2ob3o$6bobo2bobo$6b3o2b3o!

Code: Select all

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

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

Re: Spaceships in Life-like cellular automata

Post by LaundryPizza03 » May 2nd, 2020, 3:49 am

Here are the latest versions of the two files. If you would like to help me, please do! I don't think I can do this all by myself. I'm also compiling a list of non-totalistic spaceships with shape obo$o and mod ≤2.
new-gliders.db.txt
(3.87 MiB) Downloaded 138 times
oscillators.db.txt
(107.82 KiB) Downloaded 135 times

Code: Select all

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

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

Re: Spaceships in Life-like cellular automata

Post by AforAmpere » May 3rd, 2020, 1:23 pm

Here are a couple of scripts that may be useful.

The first is fromgliderdb.py, which takes the glider database, and converts it into a format usable by the other scripts. Remove the top commented section before converting. This should create a new .py file with the database in a different format, gliderlistOT.py.
The second is Glider_DatabaseOT.py, which displays all known ships in the glider database converted by the first script in Golly.
The third is getallisorule2.py, which is a modified version of the original that allows the other parts to work.
The fourth is torulestringOT.py, which allows you to paste a new ship into Golly (assuming it is in the correct rule, and travel is oriented between up and up-right), and type in the period and displacement to add it to the database. You may be prompted to type in the period twice, for reasons I have yet to find out, but it still works.

If anything is unclear or you have improvements, please say so. Credits to the majority of the parts of the code goes to Nathaniel Johnston, Peter Naszvadi, and Arie Paap.

Code: Select all

#fromgliderdb.py, which takes the glider database, and converts it into a format usable by the other scripts. Gliderfile signifies the input database file.
Gliderfile = 'Gliderdb.txt'
Outfile = 'gliderlistOT.py'
import os
import ast
import golly as g
from math import *
from string import replace
b=[]
def sc(rule):
	s=["0"]*18;m=0;t=""
	for i in range(len(rule)):
    		if rule[i]=="/":m=1
    		elif rule[i]not in"BS":s[int(rule[i])+9*m]="1"
	for j in s:
		t+=j
	return t
def chunks(l, n):
    for i in range(0, len(l), n):
        yield l[i:i+n]
def giveRLE(clist):
    # clist_chunks = list (chunks (g.evolve(clist,0), 2))
    clist_chunks = list(chunks(clist, 2))
    clist_chunks.sort(key=lambda l:l[0])
    clist_chunks.sort(key=lambda l:l[1])
    mcc = min(clist_chunks)
    rl_list = [[x[0]-mcc[0],x[1]-mcc[1]] for x in clist_chunks]
    rle_res = ""
    rle_len = 1
    rl_y = rl_list[0][1] - 1
    rl_x = 0
    for rl_i in rl_list:
        if rl_i[1] == rl_y:
            if rl_i[0] == rl_x + 1:
                rle_len += 1
            else:
                if rle_len == 1: rle_strA = ""
                else: rle_strA = str (rle_len)
                if rl_i[0] - rl_x - 1 == 1: rle_strB = ""
                else: rle_strB = str (rl_i[0] - rl_x - 1)
                
                rle_res = rle_res + rle_strA + "o" + rle_strB + "b"
                rle_len = 1
        else:
            if rle_len == 1: rle_strA = ""
            else: rle_strA = str (rle_len)
            if rl_i[1] - rl_y == 1: rle_strB = ""
            else: rle_strB = str (rl_i[1] - rl_y)
            if rl_i[0] == 1: rle_strC = "b"
            elif rl_i[0] == 0: rle_strC = ""
            else: rle_strC = str (rl_i[0]) + "b"
            
            rle_res = rle_res + rle_strA + "o" + rle_strB + "$" + rle_strC
            rle_len = 1
            
        rl_x = rl_i[0]
        rl_y = rl_i[1]
    
    if rle_len == 1: rle_strA = ""
    else: rle_strA = str (rle_len)
    rle_res = rle_res[2:] + rle_strA + "o"
    
    return rle_res+"!"
with open(Gliderfile) as fIn:
	a = fIn.read().split("\n")
open(Outfile,"w").close()
with open(Outfile,'a') as fOut:
	fOut.write("y=[\n")
for i in a:
	b += [i.split(":")]
n = 0
for i in b:
	if len(i)!=10:
		g.exit("Wrongly formatted line or end of results.")
	g.new('')
	#g.setclipstr(i[-1])
	#g.paste(0,0,"or")
	g.putcells(g.parse(i[-1]),0,0)
	g.select(g.getrect())
	f=int(i[-5]);l=int(i[-4])
	if abs(f) == abs(l) and f==0 and l==0:
		g.getstring("Hmm")
	elif abs(f) == abs(l) and f>0 and l<0:
		g.flip(1)
	elif abs(f) == abs(l) and f<0 and l>0:
		g.flip(0)
	elif abs(f) == abs(l) and f<0 and l<0:
		g.rotate(0);g.rotate(0)
	elif abs(f) > abs(l) and f>0 and l<=0:
		g.rotate(1)
	elif abs(f) > abs(l) and f>0 and l>0:
		g.rotate(0);g.flip(1)
	elif abs(f) > abs(l) and f<0 and l>=0:
		g.rotate(0)
	elif abs(f) > abs(l) and f<0 and l<0:
		g.rotate(1);g.flip(1)
	elif abs(f) < abs(l) and f>=0 and l<0:
		g.flip(1)
	elif abs(f) < abs(l) and f<0 and l>0:
		g.flip(0)
	elif abs(f) < abs(l) and f<0 and l<0:
		g.rotate(0);g.rotate(0)
	pa=giveRLE(g.getcells(g.getrect()))
	g.setrule(i[2])
	x = sc(i[2])
	y = sc(i[3])
	finstr=""
	for j in range(18):
		if x[j]=="0" and y[j]=="0":
			finstr+="0"
		elif x[j]=="0" and y[j]=="1":
			finstr+="2"
		elif x[j]=="1" and y[j]=="1":
			finstr+="1"
	with open(Outfile,'a') as fOut:
		fOut.write('["'+pa+'","'+finstr+'",['+str(max(abs(f),abs(l)))+","+str(min(abs(f),abs(l)))+","+i[-6].split("/")[0]+"]],\n")
	n+=1
	if not n%100:
		g.show(str(n)+" ships added.")
	#if n>200:
	#	break	
with open(Outfile,'a') as fOut:
	fOut.write("]")

Code: Select all

#Glider_DatabaseOT.py, assuming the new formatted glider database is still saved as gliderlistOT.py, displays known ships in it.
import golly as g;import gliderlistOT;reload(gliderlistOT);g.new("");r=g.getstring("Enter a rule:");s=[0]*18;j=m=0;a=g.getclipstr()
for i in range(len(r)):
    if r[i]=="/":m=1
    elif r[i]not in"BS":s[int(r[i])+9*m]=1
q = [];j=0;y=gliderlistOT.y
for z in y:
    p=0
    for x in range(18):
        if(s[x]==1and z[1][x]=="0")or(s[x]==0and z[1][x]=="1"):p=1
    if p==0:q+=[z]
q=sorted(q,key=lambda e:(e[2][0]-0.01/float(e[2][2]))/float(e[2][2])+e[2][1]*200.0/e[2][0]);g.setclipstr(str(q))
for v in q:g.setclipstr(v[0]);g.paste(j,0,"or");j=g.getrect()[2]+15+20*v[2][1]/v[2][2]
g.setrule(r);g.setclipstr(a)

Code: Select all

#getallisorule2.py, used for the next script.
# Rule computation script for use with Golly.
# Author: Nathaniel Johnston (nathaniel@nathanieljohnston.com), June 2009.
# Updated by: Peter, NASZVADI (), June 2017.
# Slightly modified by AforAmpere

# Gives the maximal family of rules that a still life, oscillator, or spaceship
# works under. Must be called while the rule is set of one such family
# For example, to find out what rules a glider works in, first set the rule
# to Life or HighLife, not Seeds.
# Handles nontotalistic rules, too, so it needs Golly 2.8 or newer.

import golly as g
from glife import validint
from string import replace

Hensel = [
    ['0'],
    ['1c', '1e'],
    ['2a', '2c', '2e', '2i', '2k', '2n'],
    ['3a', '3c', '3e', '3i', '3j', '3k', '3n', '3q', '3r', '3y'],
    ['4a', '4c', '4e', '4i', '4j', '4k', '4n', '4q', '4r', '4t', '4w', '4y', '4z'],
    ['5a', '5c', '5e', '5i', '5j', '5k', '5n', '5q', '5r', '5y'],
    ['6a', '6c', '6e', '6i', '6k', '6n'],
    ['7c', '7e'],
    ['8']
]

# Python versions < 2.4 don't have "sorted" built-in
try:
    sorted
except NameError:
    def sorted(inlist):
        outlist = list(inlist)
        outlist.sort()
        return outlist

# --------------------------------------------------------------------

def chunks(l, n):
    for i in range(0, len(l), n):
        yield l[i:i+n]

# --------------------------------------------------------------------

def rulestringopt(a):
    result = ''
    context = ''
    lastnum = ''
    lastcontext = ''
    for i in a:
        if i in 'BS':
            context = i
            result += i
        elif i in '012345678':
            if (i == lastnum) and (lastcontext == context):
                pass
            else:
                lastcontext = context
                lastnum = i
                result += i
        else:
            result += i
	    lastcontext = context
    result = replace(result, '4aceijknqrtwyz', '4')
    result = replace(result, '3aceijknqry', '3')
    result = replace(result, '5aceijknqry', '5')
    result = replace(result, '2aceikn', '2')
    result = replace(result, '6aceikn', '6')
    result = replace(result, '1ce', '1')
    result = replace(result, '7ce', '7')
    return result

clist = []
rule = g.getrule().split(':')[0]

fuzzer = rule + '9'
oldrule = rule
rule = ''
context = ''
deletefrom = []
for i in fuzzer:
    if i == '-':
        deletefrom = [x[1] for x in Hensel[int(context)]]
    elif i in '0123456789/S':
        if deletefrom:
            rule += ''.join(deletefrom)
            deletefrom = []
        context = i
    if len(deletefrom) == 0:
        rule += i
    elif i in deletefrom:
        deletefrom.remove(i)
rule = rule.strip('9')

if not (rule[0] == 'B' and '/S' in rule):
    g.exit('Please set Golly to a Life-like rule.')

if g.empty():
    g.exit('The pattern is empty.')

if __name__ == "__builtin__" or __name__ == "getallisorule2":    
    s = g.getstring('Enter the period:', '', 'Rules calculator')

if not validint(s):
    g.exit('Bad number: %s' % s)

numsteps = int(s)
if numsteps < 1:
    g.exit('Period must be at least 1.')

g.select(g.getrect())
g.copy()
s = int(s)

for i in range(0,s):
    g.run(1)
    clist.append(list(chunks(g.getcells(g.getrect()), 2)))
    mcc = min(clist[i])
    clist[i] = [[x[0] - mcc[0], x[1] - mcc[1]] for x in clist[i]]

g.show('Processing...')

ruleArr = rule.split('/')
ruleArr[0] = ruleArr[0].lstrip('B')
ruleArr[1] = ruleArr[1].lstrip('S')

b_need = []
b_OK = []
s_need = []
s_OK = []

context = ''
fuzzed = ruleArr[0] + '9'
for i in fuzzed:
    if i in '0123456789':
        if len(context) == 1:
            b_need += Hensel[int(context)]
            b_OK += Hensel[int(context)]
        context = i
    elif context != '':
        b_need.append(context[0] + i)
        b_OK.append(context[0] + i)
        context += context[0]
context = ''
fuzzed = ruleArr[1] + '9'
for i in fuzzed:
    if i in '0123456789':
        if len(context) == 1:
            s_need += Hensel[int(context)]
            s_OK += Hensel[int(context)]
        context = i
    elif context != '':
        s_need.append(context[0] + i)
        s_OK.append(context[0] + i)
        context += context[0]

for i in [iter2 for iter1 in Hensel for iter2 in iter1]:
    if not i in b_OK:
        b_OK.append(i)
        execfor = 1
        # B0 and nontotalistic rulestrings are mutually exclusive
        try:
            g.setrule(rulestringopt('B' + ''.join(b_OK) + '/S' + ruleArr[1]))
        except:
            b_OK.remove(i)
            execfor = 0
        for j in range(0, s * execfor):
            g.run(1)
            try:
                dlist = list(chunks(g.getcells(g.getrect()), 2))
                mcc = min(dlist)
                dlist = [[x[0] - mcc[0], x[1] - mcc[1]] for x in dlist]
                if not(clist[j] == dlist):
                    b_OK.remove(i)
                    break
            except:
                b_OK.remove(i)
                break
        g.new('')
        g.paste(0, 0, 'or')
        g.select(g.getrect())
        b_OK.sort()

    if not i in s_OK:
        s_OK.append(i)
        execfor = 1
        # B0 and nontotalistic rulestrings are mutually exclusive
        try:
            g.setrule(rulestringopt('B' + ruleArr[0] + '/S' + ''.join(s_OK)))
        except:
            s_OK.remove(i)
            execfor = 0
        for j in range(0, s * execfor):
            g.run(1)
            try:
                dlist = list(chunks(g.getcells(g.getrect()), 2))
                mcc = min(dlist)
                dlist = [[x[0] - mcc[0], x[1] - mcc[1]] for x in dlist]
                if not(clist[j] == dlist):
                    s_OK.remove(i)
                    break
            except:
                s_OK.remove(i)
                break
        g.new('')
        g.paste(0, 0, 'or')
        g.select(g.getrect())
        s_OK.sort()

    if i in b_need:
        b_need.remove(i)
        g.setrule(rulestringopt('B' + ''.join(b_need) + '/S' + ruleArr[1]))
        for j in range(0, s):
            g.run(1)
            try:
                dlist = list(chunks(g.getcells(g.getrect()), 2))
                mcc = min(dlist)
                dlist = [[x[0] - mcc[0], x[1] - mcc[1]] for x in dlist]
                if not(clist[j] == dlist):
                    b_need.append(i)
                    break
            except:
                b_need.append(i)
                break
        g.new('')
        g.paste(0, 0, 'or')
        g.select(g.getrect())
        b_need.sort()

    if i in s_need:
        s_need.remove(i)
        g.setrule(rulestringopt('B' + ruleArr[0] + '/S' + ''.join(s_need)))
        for j in range(0, s):
            g.run(1)
            try:
                dlist = list(chunks(g.getcells(g.getrect()), 2))
                mcc = min(dlist)
                dlist = [[x[0] - mcc[0], x[1] - mcc[1]] for x in dlist]
                if not(clist[j] == dlist):
                    s_need.append(i)
                    break
            except:
                s_need.append(i)
                break
        g.new('')
        g.paste(0, 0, 'or')
        g.select(g.getrect())
        s_need.sort()

g.setrule(oldrule)
ruleres = 'B' + ''.join(sorted(b_need)) + '/S' + ''.join(sorted(s_need)) + \
    ' - B' + ''.join(sorted(b_OK)) + '/S' + ''.join(sorted(s_OK))
#g.getstring(ruleres)
ruleres = rulestringopt(ruleres)
if __name__ == "__builtin__":    
    g.show(ruleres)
    g.getstring('Pattern works in rules:', ruleres, 'Rules calculator')
else:
    g.show(__name__)

Code: Select all

#torulestringOT.py. Paste a ship you want to add to the database into Golly, and run this script. It will ask for period and displacement, and once those are provided, the ship will be added to the database.
import golly as g
import os
import sys
Outfile = "gliderlistOT.py"
#g.new("")
class RuleGenerator:
    notationdict = {
        "0"  : [0,0,0,0,0,0,0,0],   #    
        "1e" : [1,0,0,0,0,0,0,0],   #   N
        "1c" : [0,1,0,0,0,0,0,0],   #   NE
        "2a" : [1,1,0,0,0,0,0,0],   #   N,  NE
        "2e" : [1,0,1,0,0,0,0,0],   #   N,  E
        "2k" : [1,0,0,1,0,0,0,0],   #   N,  SE
        "2i" : [1,0,0,0,1,0,0,0],   #   N,  S
        "2c" : [0,1,0,1,0,0,0,0],   #   NE, SE
        "2n" : [0,1,0,0,0,1,0,0],   #   NE, SW
        "3a" : [1,1,1,0,0,0,0,0],   #   N,  NE, E
        "3n" : [1,1,0,1,0,0,0,0],   #   N,  NE, SE
        "3r" : [1,1,0,0,1,0,0,0],   #   N,  NE, S
        "3q" : [1,1,0,0,0,1,0,0],   #   N,  NE, SW
        "3j" : [1,1,0,0,0,0,1,0],   #   N,  NE, W
        "3i" : [1,1,0,0,0,0,0,1],   #   N,  NE, NW
        "3e" : [1,0,1,0,1,0,0,0],   #   N,  E,  S
        "3k" : [1,0,1,0,0,1,0,0],   #   N,  E,  SW
        "3y" : [1,0,0,1,0,1,0,0],   #   N,  SE, SW
        "3c" : [0,1,0,1,0,1,0,0],   #   NE, SE, SW
        "4a" : [1,1,1,1,0,0,0,0],   #   N,  NE, E,  SE
        "4r" : [1,1,1,0,1,0,0,0],   #   N,  NE, E,  S
        "4q" : [1,1,1,0,0,1,0,0],   #   N,  NE, E,  SW
        "4i" : [1,1,0,1,1,0,0,0],   #   N,  NE, SE, S
        "4y" : [1,1,0,1,0,1,0,0],   #   N,  NE, SE, SW
        "4k" : [1,1,0,1,0,0,1,0],   #   N,  NE, SE, W
        "4n" : [1,1,0,1,0,0,0,1],   #   N,  NE, SE, NW
        "4z" : [1,1,0,0,1,1,0,0],   #   N,  NE, S,  SW
        "4j" : [1,1,0,0,1,0,1,0],   #   N,  NE, S,  W
        "4t" : [1,1,0,0,1,0,0,1],   #   N,  NE, S,  NW
        "4w" : [1,1,0,0,0,1,1,0],   #   N,  NE, SW, W
        "4e" : [1,0,1,0,1,0,1,0],   #   N,  E,  S,  W
        "4c" : [0,1,0,1,0,1,0,1],   #   NE, SE, SW, NW
        "5i" : [1,1,1,1,1,0,0,0],   #   N,  NE, E,  SE, S
        "5j" : [1,1,1,1,0,1,0,0],   #   N,  NE, E,  SE, SW
        "5n" : [1,1,1,1,0,0,1,0],   #   N,  NE, E,  SE, W
        "5a" : [1,1,1,1,0,0,0,1],   #   N,  NE, E,  SE, NW
        "5q" : [1,1,1,0,1,1,0,0],   #   N,  NE, E,  S,  SW
        "5c" : [1,1,1,0,1,0,1,0],   #   N,  NE, E,  S,  W
        "5r" : [1,1,0,1,1,1,0,0],   #   N,  NE, SE, S,  SW
        "5y" : [1,1,0,1,1,0,1,0],   #   N,  NE, SE, S,  W
        "5k" : [1,1,0,1,0,1,1,0],   #   N,  NE, SE, SW, W
        "5e" : [1,1,0,1,0,1,0,1],   #   N,  NE, SE, SW, NW
        "6a" : [1,1,1,1,1,1,0,0],   #   N,  NE, E,  SE, S,  SW
        "6c" : [1,1,1,1,1,0,1,0],   #   N,  NE, E,  SE, S,  W
        "6k" : [1,1,1,1,0,1,1,0],   #   N,  NE, E,  SE, SW, W
        "6e" : [1,1,1,1,0,1,0,1],   #   N,  NE, E,  SE, SW, NW
        "6n" : [1,1,1,0,1,1,1,0],   #   N,  NE, E,  S,  SW, W
        "6i" : [1,1,0,1,1,1,0,1],   #   N,  NE, SE, S,  SW, NW
        "7c" : [1,1,1,1,1,1,1,0],   #   N,  NE, E,  SE, S,  SW, W
        "7e" : [1,1,1,1,1,1,0,1],   #   N,  NE, E,  SE, S,  SW, NW
        "8"  : [1,1,1,1,1,1,1,1],   #   N,  NE, E,  SE, S,  SW, W,  NW
        }
    
    allneighbours = [  
        ["0"],
        ["1e", "1c"],
        ["2a", "2e", "2k", "2i", "2c", "2n"],
        ["3a", "3n", "3r", "3q", "3j", "3i", "3e", "3k", "3y", "3c"],
        ["4a", "4r", "4q", "4i", "4y", "4k", "4n", "4z", "4j", "4t", "4w", "4e", "4c"],
        ["5i", "5j", "5n", "5a", "5q", "5c", "5r", "5y", "5k", "5e"],
        ["6a", "6c", "6k", "6e", "6n", "6i"],
        ["7c", "7e"],
        ["8"],
        ]
        
    allneighbours_flat = [n for x in allneighbours for n in x]
    
    numneighbours = len(notationdict)
    
    # Use dict to store rule elements, initialised by setrule():
    bee = {}
    ess = {}
    alphanumeric = ""
    rulename = ""
    
    # Save the isotropic rule
    def saveAllRules(self):    
        self.saveIsotropicRule()
    
    # Interpret birth or survival string
    def ruleparts(self, part):

        inverse = False
        nlist = []
        totalistic = True
        rule = { k: False for k, v in self.notationdict.iteritems() }
        
        # Reverse the rule string to simplify processing
        part = part[::-1]
        
        for c in part:
            if c.isdigit():
                d = int(c)
                if totalistic:
                    # Add all the neighbourhoods for this value
                    for neighbour in self.allneighbours[d]:
                        rule[neighbour] = True
                elif inverse:
                    # Add all the neighbourhoods not in nlist for this value
                    for neighbour in self.allneighbours[d]:
                        if neighbour[1] not in nlist:
                            rule[neighbour] = True
                else:
                    # Add all the neighbourhoods in nlist for this value
                    for n in nlist:
                        neighbour = c + n
                        if neighbour in rule:
                            rule[neighbour] = True
                        else:
                            # Error
                            return {}
                    
                inverse = False
                nlist = []
                totalistic = True

            elif (c == '-'):
                inverse = True

            else:
                totalistic = False
                nlist.append(c)
        
        return rule

    # Set isotropic, non-totalistic rule
    # Adapted from Eric Goldstein's HenselNotation->Ruletable(1.3).py
    def setrule(self, rulestring):
    
        # neighbours_flat = [n for x in neighbours for n in x]
        b = {}
        s = {}
        sep = ''
        birth = ''
        survive = ''
        
        rulestring = rulestring.lower()
        
        if '/' in rulestring:
            sep = '/'
        elif '_' in rulestring:
            sep = '_'
        elif (rulestring[0] == 'b'):
            sep = 's'
        else:
            sep = 'b'
        
        survive, birth = rulestring.split(sep)
        if (survive[0] == 'b'):
            survive, birth = birth, survive
        survive = survive.replace('s', '')
        birth = birth.replace('b', '')
        
        b = self.ruleparts(birth)
        s = self.ruleparts(survive)

        if b and s:
            self.alphanumeric = 'B' + birth + 'S' + survive
            self.rulename = 'B' + birth + '_S' + survive
            self.bee = b
            self.ess = s
        else:
            # Error
            g.note("Unable to process rule definition.\n" +
                    "b = " + str(b) + "\ns = " + str(s))
            g.exit()
            

    # Save a rule file:
    def saverule(self, name, comments, table, colours):
        
        ruledir = g.getdir("rules")
        filename = ruledir + name + ".rule"

        global results
	results = ""
        results += table

        # Only create a rule file if it doesn't already exist; this avoids
        # concurrency issues when booting an instance of apgsearch whilst
        # one is already running.
        

    # Defines a variable:
    def newvar(self, name, vallist):

        line = "var "+name+"={"
        for i in xrange(len(vallist)):
            if (i > 0):
                line += ','
            line += str(vallist[i])
        line += "}\n"

        return line

    # Defines a block of equivalent variables:
    def newvars(self, namelist, vallist):

        block = "\n"

        for name in namelist:
            block += self.newvar(name, vallist)

        return block

    def scoline(self, chara, charb, left, right, amount):

        line = str(left) + ","

        for i in xrange(8):
            if (i < amount):
                line += chara
            else:
                line += charb
            line += chr(97 + i)
            line += ","

        line += str(right) + "\n"

        return line

    def isotropicline(self, chara, charb, left, right, n):

        line = str(left) + ","
        neighbours = self.notationdict[n]
        
        for i in xrange(8):
            if neighbours[i]:
                line += chara
            else:
                line += charb
            line += chr(97 + i)
            line += ","

        line += str(right) + "\n"

        return line
        
    def saveIsotropicRule(self):
    
  

        table = """"""

        for n in self.allneighbours_flat:
            if self.bee[n]:
                table += "1"
	    else:
		table += "0"

        for n in self.allneighbours_flat:
            if self.ess[n]:
                table += "1"
	    else:
		table += "0"
        
        colours = ""
	comments = ""
        self.saverule(self.rulename, comments, table, colours)


import golly as g
if __name__ == "__builtin__":
    import getallisorule2; reload(getallisorule2)
    a = str(getallisorule2.ruleres)
else:
    import getallisorule3; reload(getallisorule3)
    a = str(getallisorule3.ruleres)
min,max = a.split("-")
min = str(min.strip())
max = str(max.strip())
rulestring = min #g.getstring("Enter minimum rule string:")

rulestring2 = max #g.getstring("Enter maximum rule string:")

rg = RuleGenerator()

rg.setrule(rulestring)
rg.saveIsotropicRule()
q = results
rg.setrule(rulestring2)
rg.saveIsotropicRule()
t = results
g.setrule(rulestring)

# g.show(results)

final = ""
for z in range(len(q)):
    if q[z] == t[z]:
	final+=q[z]
    else:
        final+="2"
tfinal=""
def ch(a,b):
	global final
	if "0" in final[a:b]:
		return "0"
	elif "1" in final[a:b]:
		return "1"
	else:
		return "2"
tfinal+=ch(0,1)+ch(1,3)+ch(3,9)+ch(9,19)+ch(19,32)+ch(32,42)+ch(42,48)+ch(48,50)+ch(50,51)
tfinal+=ch(51,52)+ch(52,54)+ch(54,60)+ch(60,70)+ch(70,83)+ch(83,93)+ch(93,99)+ch(99,101)+ch(101,102)
g.select(g.getrect());g.copy()
j=g.getstring("Enter the displacement in form 'a,b' where a>b:")
n = ('["'+g.getclipstr()[g.getclipstr().find("\n")+1:].replace("\n","")+'","'+tfinal+'",['+j+','+str(getallisorule2.s)+']],')	
with open(Outfile) as fIn:
	a = fIn.read().split("\n")
with open(Outfile,'rb+') as fUh:
	fUh.seek(-1,2)
	fUh.truncate()
with open(Outfile,'a') as fOut:
	if n not in a:
		fOut.write(n+"\n]")
	else:
		fOut.write("]")
Last edited by AforAmpere on May 7th, 2020, 12:54 am, edited 1 time in total.
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.

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

Re: Spaceships in Life-like cellular automata

Post by LaundryPizza03 » May 6th, 2020, 10:56 pm

When fromgliderdb.py reached the end of the list, it threw an exception:

Code: Select all

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "fromgliderdb.py", line 78, in <module>
    f=int(i[-5]);l=int(i[-4])
  IndexError: list index out of range
Then the array in gliderlistOT.py didn't close properly.

Code: Select all

...
["4bobo$4b3o$2o3bo3b2o$3o2bo2b3o$4obob4o$2b2o3b2o$2bobobobo!","000100111010101110",[4,0,48]], <- last , should be ]

Code: Select all

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

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

Re: Spaceships in Life-like cellular automata

Post by AforAmpere » May 7th, 2020, 12:47 am

LaundryPizza03 wrote:
May 6th, 2020, 10:56 pm
When fromgliderdb.py reached the end of the list, it threw an exception:
I think that may be caused by me not checking if lines are in proper format. It is probably crashing on an empty last line. I'll fix that.
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