Tutorials/gfind: Difference between revisions

From LifeWiki
Jump to navigation Jump to search
Created page with "Oh so you want to learn gfind, eh? === Things to do before === If you haven't, go to the Compiling C Code tutorial first. == Basic gfind == Let's sta..."
 
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Oh so you want to learn gfind, eh?
Oh, so you want to learn gfind, eh?


=== Things to do before ===
=== Things to do first ===
If you haven't, go to the [[Tutorials/Compiling|Compiling C Code]] tutorial first.
If you haven't, go to the [[Tutorials/Compiling|Compiling C Code]] tutorial first.


== Basic gfind ==
== Basic gfind ==
Let's start by opening gfind, if you forgot how, here:<br/>
Let's start by opening gfind, if you forgot how, here:
<code>
 
cd /C/gfind<br/>
<pre>
./gfind<br/>
cd /C/gfind
</code>
./gfind
Now, you should see a line that says:<br/>
</pre>
<code>
 
gfind 4.9, D. Eppstein, 20 August 2011 <br/>
Now, you should see a line that says:
Rule (return for help): </code>
 
Good, you've started up gfind. Now, try typing in the following: <br/>
<pre>
<code>b3/s23</code> <br/>
gfind 4.9, D. Eppstein, 20 August 2011  
That's the '''rule''' we are going to search. Now press '''enter''', it should give a big list of "stuff" that looks like this:<br/>
Rule (return for help):
<code>
</pre>
Constructing c/2 edge filters... found 12156/65536 patterns<br/>
 
Searching for speed c/2, width 12.<br/>
If so, good, you've started up gfind. Now, try typing in the following:
Searching for speed c/2, width 12, glide-reflect symmetry.<br/>
 
<br/>
<pre>b3/s23</pre>
x = 11, y = 5, rule = B3/S23<br/>
 
b2o5b2o$b3o4b3o$ob2o3bob2o$3o4b3o$bo6bo!<br/>
That's the '''rule''' we are going to search. Now press '''enter''', it should give a big list of "stuff" that looks like this:
<br/>
 
Searching for speed c/3, width 8.<br/>
<pre>
Searching for speed c/3, width 8, glide-reflect symmetry.<br/>
Constructing c/2 edge filters... found 12156/65536 patterns
Searching for speed c/3, width 9, glide-reflect symmetry.<br/>
Searching for speed c/2, width 12.
Searching for speed c/3, width 15, bilateral symmetry.<br/>
Searching for speed c/2, width 12, glide-reflect symmetry.
<br/>
 
x = 15, y = 9, rule = B3/S23<br/>
x = 11, y = 5, rule = B3/S23
b2obobobobob2o$o3b3ob3o3bo$bob2obobob2obo$2bob2o3b2obo$5bo3bo2$<br/>
b2o5b2o$b3o4b3o$ob2o3bob2o$3o4b3o$bo6bo!
5bo3bo$6b3o$6b3o!<br/>
 
<br/>
Searching for speed c/3, width 8.
Searching for speed c/4, width 6.<br/>
Searching for speed c/3, width 8, glide-reflect symmetry.
Searching for speed c/4, width 6, glide-reflect symmetry.<br/>
Searching for speed c/3, width 9, glide-reflect symmetry.
Searching for speed c/4, width 7, glide-reflect symmetry.<br/>
Searching for speed c/3, width 15, bilateral symmetry.
Searching for speed c/4, width 11, bilateral symmetry.<br/>
 
Searching for speed c/4, width 12, bilateral symmetry.<br/>
x = 15, y = 9, rule = B3/S23
Searching for speed c/4, width 13, bilateral symmetry, gutter.<br/>
b2obobobobob2o$o3b3ob3o3bo$bob2obobob2obo$2bob2o3b2obo$5bo3bo2$
Searching for speed 2c/4, width 6.<br/>
5bo3bo$6b3o$6b3o!
<br/>
 
x = 4, y = 5, rule = B3/S23<br/>
Searching for speed c/4, width 6.
b2o$3o$2obo$b3o$2bo!<br/>
Searching for speed c/4, width 6, glide-reflect symmetry.
<br/>
Searching for speed c/4, width 7, glide-reflect symmetry.
Searching for speed c/4, width 6, diagonal.<br/>
Searching for speed c/4, width 11, bilateral symmetry.
<br/>
Searching for speed c/4, width 12, bilateral symmetry.
x = 3, y = 3, rule = B3/S23<br/>
Searching for speed c/4, width 13, bilateral symmetry, gutter.
obo$2o$bo!<br/>
Searching for speed 2c/4, width 6.
<br/>
 
Searching for speed c/5, width 5.<br/>
x = 4, y = 5, rule = B3/S23
Searching for speed c/5, width 5, glide-reflect symmetry.<br/>
b2o$3o$2obo$b3o$2bo!
Searching for speed c/5, width 6, glide-reflect symmetry.<br/>
 
Searching for speed c/5, width 9, bilateral symmetry.<br/>
Searching for speed c/4, width 6, diagonal.
Searching for speed c/5, width 10, bilateral symmetry.<br/>
 
Searching for speed c/5, width 11, bilateral symmetry, gutter.<br/>
x = 3, y = 3, rule = B3/S23
Searching for speed 2c/5, width 5.<br/>
obo$2o$bo!
Searching for speed 2c/5, width 5, glide-reflect symmetry.<br/>
 
Searching for speed 2c/5, width 6, glide-reflect symmetry.<br/>
Searching for speed c/5, width 5.
Searching for speed 2c/5, width 9, bilateral symmetry.<br/>
Searching for speed c/5, width 5, glide-reflect symmetry.
Searching for speed 2c/5, width 10, bilateral symmetry.<br/>
Searching for speed c/5, width 6, glide-reflect symmetry.
Searching for speed 2c/5, width 11, bilateral symmetry, gutter.<br/>
Searching for speed c/5, width 9, bilateral symmetry.
Searching for speed c/5, width 5, diagonal.<br/>
Searching for speed c/5, width 10, bilateral symmetry.
Searching for speed c/5, width 9, diagonal, bilateral symmetry.<br/>
Searching for speed c/5, width 11, bilateral symmetry, gutter.
Searching for speed c/5, width 11, diagonal, bilateral symmetry, gutter.<br/>
Searching for speed 2c/5, width 5.
Searching for speed c/5, width 12, diagonal, skew gutter.<br/>
Searching for speed 2c/5, width 5, glide-reflect symmetry.
Searching for speed c/6, width 4.<br/>
Searching for speed 2c/5, width 6, glide-reflect symmetry.
Searching for speed c/6, width 4, glide-reflect symmetry.<br/>
Searching for speed 2c/5, width 9, bilateral symmetry.
Searching for speed c/6, width 5, glide-reflect symmetry.<br/>
Searching for speed 2c/5, width 10, bilateral symmetry.
Searching for speed c/6, width 7, bilateral symmetry.<br/>
Searching for speed 2c/5, width 11, bilateral symmetry, gutter.
Searching for speed c/6, width 8, bilateral symmetry.<br/>
Searching for speed c/5, width 5, diagonal.
Searching for speed c/6, width 9, bilateral symmetry, gutter.<br/>
Searching for speed c/5, width 9, diagonal, bilateral symmetry.
Searching for speed 2c/6, width 4.<br/>
Searching for speed c/5, width 11, diagonal, bilateral symmetry, gutter.
Searching for speed 2c/6, width 7, bilateral symmetry.<br/>
Searching for speed c/5, width 12, diagonal, skew gutter.
Searching for speed 2c/6, width 8, bilateral symmetry.<br/>
Searching for speed c/6, width 4.
Searching for speed 2c/6, width 9, bilateral symmetry, gutter.<br/>
Searching for speed c/6, width 4, glide-reflect symmetry.
Searching for speed 3c/6, width 4.<br/>
Searching for speed c/6, width 5, glide-reflect symmetry.
Searching for speed 3c/6, width 4, glide-reflect symmetry.<br/>
Searching for speed c/6, width 7, bilateral symmetry.
Searching for speed 3c/6, width 5, glide-reflect symmetry.<br/>
Searching for speed c/6, width 8, bilateral symmetry.
Searching for speed 3c/6, width 7, bilateral symmetry.<br/>
Searching for speed c/6, width 9, bilateral symmetry, gutter.
Searching for speed 3c/6, width 8, bilateral symmetry.<br/>
Searching for speed 2c/6, width 4.
Searching for speed 3c/6, width 9, bilateral symmetry, gutter.<br/>
Searching for speed 2c/6, width 7, bilateral symmetry.
Searching for speed c/6, width 4, diagonal.<br/>
Searching for speed 2c/6, width 8, bilateral symmetry.
Searching for speed c/6, width 7, diagonal, bilateral symmetry.<br/>
Searching for speed 2c/6, width 9, bilateral symmetry, gutter.
Searching for speed c/6, width 8, diagonal, glide-reflect symmetry.<br/>
Searching for speed 3c/6, width 4.
Searching for speed c/6, width 9, diagonal, bilateral symmetry, gutter.<br/>
Searching for speed 3c/6, width 4, glide-reflect symmetry.
Searching for speed c/6, width 10, diagonal, skew gutter.<br/>
Searching for speed 3c/6, width 5, glide-reflect symmetry.
Search complete.<br/>
Searching for speed 3c/6, width 7, bilateral symmetry.
</code>
Searching for speed 3c/6, width 8, bilateral symmetry.
Look, it has some RLEs! But before we go into that, let's break it down a bit. You see, there are a lot of lines that look like "Searching for speed XX, width XX, XXX, XX", where X is a different thing. Let's see what each "X" means:<br/>
Searching for speed 3c/6, width 9, bilateral symmetry, gutter.
<code>Searching for speed c/5, width 11, diagonal, bilateral symmetry, gutter.</code>
Searching for speed c/6, width 4, diagonal.
Searching for speed c/6, width 7, diagonal, bilateral symmetry.
Searching for speed c/6, width 8, diagonal, glide-reflect symmetry.
Searching for speed c/6, width 9, diagonal, bilateral symmetry, gutter.
Searching for speed c/6, width 10, diagonal, skew gutter.
Search complete.
</pre>
 
Look, it has some RLEs! But before we go into that, let's break it down a bit. You see, there are a lot of lines that look like "Searching for speed XX, width XX, XXX, XX", where X is a different thing. Let's see what each "X" means:
 
<pre>Searching for speed c/5, width 11, diagonal, bilateral symmetry, gutter.</pre>
 
*'''Searching for speed c/5''': This is the speed it's searching in, like c/2, c/3, and so on. In this case, it is looking for c/5 spaceships.
*'''Searching for speed c/5''': This is the speed it's searching in, like c/2, c/3, and so on. In this case, it is looking for c/5 spaceships.
*'''width 11''': This is the width of the spaceship it is looking for, in this case, 11 cells, which means it's looking for a '''c/5''' '''11-cell-wide''' spaceship.
*'''width 11''': This is the width of the spaceship it's looking for, in this case, 11 cells, which means it's looking for a '''c/5''' '''11-cell-wide''' spaceship.
*'''diagonal''': This means it is looking for a '''diagonal''' spaceship, lines without this mean it's looking for an '''orthogonal''' one.
*'''diagonal''': This means it is looking for a '''diagonal''' spaceship, lines without this mean it's looking for an '''orthogonal''' one.
*'''bilateral symmetry''': This means it will search '''symmetrical''' spaceships, which are usually easier to find.
*'''bilateral symmetry''': This means it will search '''symmetrical''' spaceships, which are usually easier to find.
*'''gutter''': A '''gutter''' is an empty space between halves of a bilaterally symmetric spaceship.
*'''gutter''': A '''gutter''' is an empty space between halves of a bilaterally symmetric spaceship.
Unfortunately, it did not find a '''c/5 bilaterally symmetric diagonal gutter''' spaceship, but for some others, it did. Let's look at the RLE that is shown after '''Searching for speed c/3, width 15, bilateral symmetry.''':<br/>
 
<code>x = 15, y = 9, rule = B3/S23 </br>
Unfortunately, it did not find a '''c/5 bilaterally symmetric diagonal gutter''' spaceship, but for some others, it did. Let's look at the RLE that is shown after '''Searching for speed c/3, width 15, bilateral symmetry.''':
 
<pre>x = 15, y = 9, rule = B3/S23  
b2obobobobob2o$o3b3ob3o3bo$bob2obobob2obo$2bob2o3b2obo$5bo3bo2$
b2obobobobob2o$o3b3ob3o3bo$bob2obobob2obo$2bob2o3b2obo$5bo3bo2$
5bo3bo$6b3o$6b3o!
5bo3bo$6b3o$6b3o!
</code>
</pre>
Now, if you paste that into Golly, you will see a [[Turtle]], you've succeeded in rediscovering a spaceship! You can do this with other rules too, try '''b2/s''', '''b34/s34''', or '''b368/s236'''.
 
Now, if you copy and paste that into Golly, you will see a [[Dart]], you've succeeded in rediscovering a spaceship! You can do this with other rules too, try '''b2/s''', '''b34/s34''', or '''b368/s236'''.


== Parameters ==
== Parameters ==
You can also specify some parameters, like speed. To do that, after the rule, type in "/o(Speed)v/l(Level)", '''Speed''' is the speed (Although if you enter e.g. 7, it will search c/7, 2c/7, '''and''' 3c/7), and '''Level''' is the level of depth it will go to, a higher level will generally mean bigger ships and longer search. The following will search for a c/4 at level 75:<br/>
You can also specify some parameters, like speed. To do that, after the rule, type in "/o(Speed)v/l(Level)", '''Speed''' is the speed (Although if you enter e.g. 7, it will search c/7, 2c/7, '''and''' 3c/7), and '''Level''' is the level of depth it will go to, a higher level will generally mean bigger ships and longer search. The following will search for a c/4 at level 75:
<code>
 
<pre>
b3/s23/o4v/l75
b3/s23/o4v/l75
</code>
</pre>
It should take only about 1 minute or less, don't worry about the extra lines in outputs. After it's done, it should output the following RLE:<br/>
 
<code>x = 16, y = 22, rule = B3/S23 <br/>
It should take only about 1 minute or less, don't worry about the extra lines of outputs. After it's done, it should output the following RLE:
 
<pre>
x = 16, y = 22, rule = B3/S23  
4bo2b2o2bo$4bob4obo$obobo6bobobo$obo10bobo$o14bo2$2o3b6o3b2o$bo
4bo2b2o2bo$4bob4obo$obobo6bobobo$obo10bobo$o14bo2$2o3b6o3b2o$bo
4b4o4bo$b4o6b4o$2b3o6b3o$2b3ob4ob3o2$6b4o$4b3o2b3o$2bo2b2o2b2o2b
4b4o4bo$b4o6b4o$2b3o6b3o$2b3ob4ob3o2$6b4o$4b3o2b3o$2bo2b2o2b2o2b
o$4bo6bo$o3bo6bo3bo$obo10bobo2$3o10b3o$3o10b3o$bo12bo!
o$4bo6bo$o3bo6bo3bo$obo10bobo2$3o10b3o$3o10b3o$bo12bo!
</code>
</pre>
 
There! You have found a c/4 spaceship.
There! You have found a c/4 spaceship.
==== Word of Caution ====
==== Word of Caution ====
Do '''NOT''' post "discoveries" you have made on the LifeWiki '''unless''' it is:
Do not create articles for your discoveries on the LifeWiki. Report them to the [[ConwayLife.com]] forum instead, especially if the ship is interesting, e.g.:
*A new speed
 
*A knightship
*A new [[speed]]
*The smallest of it's speed
*An [[oblique spaceship]]
*Does something super cool (Like turn a glider into copies of itself)
*The smallest of its speed
*Does something super cool (Like turn a [[glider]] into copies of itself)
 
If the ship is notable, someone else will (sooner or later) create an article for it.
 
{{Tutorial}}

Latest revision as of 13:04, 3 September 2023

Oh, so you want to learn gfind, eh?

Things to do first

If you haven't, go to the Compiling C Code tutorial first.

Basic gfind

Let's start by opening gfind, if you forgot how, here:

cd /C/gfind
./gfind

Now, you should see a line that says:

gfind 4.9, D. Eppstein, 20 August 2011 
Rule (return for help):

If so, good, you've started up gfind. Now, try typing in the following:

b3/s23

That's the rule we are going to search. Now press enter, it should give a big list of "stuff" that looks like this:

Constructing c/2 edge filters... found 12156/65536 patterns
Searching for speed c/2, width 12.
Searching for speed c/2, width 12, glide-reflect symmetry.

x = 11, y = 5, rule = B3/S23
b2o5b2o$b3o4b3o$ob2o3bob2o$3o4b3o$bo6bo!

Searching for speed c/3, width 8.
Searching for speed c/3, width 8, glide-reflect symmetry.
Searching for speed c/3, width 9, glide-reflect symmetry.
Searching for speed c/3, width 15, bilateral symmetry.

x = 15, y = 9, rule = B3/S23
b2obobobobob2o$o3b3ob3o3bo$bob2obobob2obo$2bob2o3b2obo$5bo3bo2$
5bo3bo$6b3o$6b3o!

Searching for speed c/4, width 6.
Searching for speed c/4, width 6, glide-reflect symmetry.
Searching for speed c/4, width 7, glide-reflect symmetry.
Searching for speed c/4, width 11, bilateral symmetry.
Searching for speed c/4, width 12, bilateral symmetry.
Searching for speed c/4, width 13, bilateral symmetry, gutter.
Searching for speed 2c/4, width 6.

x = 4, y = 5, rule = B3/S23
b2o$3o$2obo$b3o$2bo!

Searching for speed c/4, width 6, diagonal.

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

Searching for speed c/5, width 5.
Searching for speed c/5, width 5, glide-reflect symmetry.
Searching for speed c/5, width 6, glide-reflect symmetry.
Searching for speed c/5, width 9, bilateral symmetry.
Searching for speed c/5, width 10, bilateral symmetry.
Searching for speed c/5, width 11, bilateral symmetry, gutter.
Searching for speed 2c/5, width 5.
Searching for speed 2c/5, width 5, glide-reflect symmetry.
Searching for speed 2c/5, width 6, glide-reflect symmetry.
Searching for speed 2c/5, width 9, bilateral symmetry.
Searching for speed 2c/5, width 10, bilateral symmetry.
Searching for speed 2c/5, width 11, bilateral symmetry, gutter.
Searching for speed c/5, width 5, diagonal.
Searching for speed c/5, width 9, diagonal, bilateral symmetry.
Searching for speed c/5, width 11, diagonal, bilateral symmetry, gutter.
Searching for speed c/5, width 12, diagonal, skew gutter.
Searching for speed c/6, width 4.
Searching for speed c/6, width 4, glide-reflect symmetry.
Searching for speed c/6, width 5, glide-reflect symmetry.
Searching for speed c/6, width 7, bilateral symmetry.
Searching for speed c/6, width 8, bilateral symmetry.
Searching for speed c/6, width 9, bilateral symmetry, gutter.
Searching for speed 2c/6, width 4.
Searching for speed 2c/6, width 7, bilateral symmetry.
Searching for speed 2c/6, width 8, bilateral symmetry.
Searching for speed 2c/6, width 9, bilateral symmetry, gutter.
Searching for speed 3c/6, width 4.
Searching for speed 3c/6, width 4, glide-reflect symmetry.
Searching for speed 3c/6, width 5, glide-reflect symmetry.
Searching for speed 3c/6, width 7, bilateral symmetry.
Searching for speed 3c/6, width 8, bilateral symmetry.
Searching for speed 3c/6, width 9, bilateral symmetry, gutter.
Searching for speed c/6, width 4, diagonal.
Searching for speed c/6, width 7, diagonal, bilateral symmetry.
Searching for speed c/6, width 8, diagonal, glide-reflect symmetry.
Searching for speed c/6, width 9, diagonal, bilateral symmetry, gutter.
Searching for speed c/6, width 10, diagonal, skew gutter.
Search complete.

Look, it has some RLEs! But before we go into that, let's break it down a bit. You see, there are a lot of lines that look like "Searching for speed XX, width XX, XXX, XX", where X is a different thing. Let's see what each "X" means:

Searching for speed c/5, width 11, diagonal, bilateral symmetry, gutter.
  • Searching for speed c/5: This is the speed it's searching in, like c/2, c/3, and so on. In this case, it is looking for c/5 spaceships.
  • width 11: This is the width of the spaceship it's looking for, in this case, 11 cells, which means it's looking for a c/5 11-cell-wide spaceship.
  • diagonal: This means it is looking for a diagonal spaceship, lines without this mean it's looking for an orthogonal one.
  • bilateral symmetry: This means it will search symmetrical spaceships, which are usually easier to find.
  • gutter: A gutter is an empty space between halves of a bilaterally symmetric spaceship.

Unfortunately, it did not find a c/5 bilaterally symmetric diagonal gutter spaceship, but for some others, it did. Let's look at the RLE that is shown after Searching for speed c/3, width 15, bilateral symmetry.:

x = 15, y = 9, rule = B3/S23 
b2obobobobob2o$o3b3ob3o3bo$bob2obobob2obo$2bob2o3b2obo$5bo3bo2$
5bo3bo$6b3o$6b3o!

Now, if you copy and paste that into Golly, you will see a Dart, you've succeeded in rediscovering a spaceship! You can do this with other rules too, try b2/s, b34/s34, or b368/s236.

Parameters

You can also specify some parameters, like speed. To do that, after the rule, type in "/o(Speed)v/l(Level)", Speed is the speed (Although if you enter e.g. 7, it will search c/7, 2c/7, and 3c/7), and Level is the level of depth it will go to, a higher level will generally mean bigger ships and longer search. The following will search for a c/4 at level 75:

b3/s23/o4v/l75

It should take only about 1 minute or less, don't worry about the extra lines of outputs. After it's done, it should output the following RLE:

x = 16, y = 22, rule = B3/S23 
4bo2b2o2bo$4bob4obo$obobo6bobobo$obo10bobo$o14bo2$2o3b6o3b2o$bo
4b4o4bo$b4o6b4o$2b3o6b3o$2b3ob4ob3o2$6b4o$4b3o2b3o$2bo2b2o2b2o2b
o$4bo6bo$o3bo6bo3bo$obo10bobo2$3o10b3o$3o10b3o$bo12bo!

There! You have found a c/4 spaceship.

Word of Caution

Do not create articles for your discoveries on the LifeWiki. Report them to the ConwayLife.com forum instead, especially if the ship is interesting, e.g.:

If the ship is notable, someone else will (sooner or later) create an article for it.