Caterpillars

For discussion of other cellular automata.
Post Reply
User avatar
Scorbie
Posts: 1692
Joined: December 7th, 2013, 1:05 am

Caterpillars

Post by Scorbie » February 18th, 2015, 4:17 am

When I first played this rule in golly's default ruleset, I wasn't too interested. The patterns mostly stabilized into small low-period oscillators and some wickstretcher if you're lucky. However, a few days ago, I found a different backend of the wick and a breeder in this rule and thought that there may be a great deal of complexity in this rule. I hope that some of these eye candy would fascinate you too.
The puffer that started it all:

Code: Select all

x = 10, y = 5, rule = Caterpillars
7.A.A$AB.AC2A2.A$5AB$5AC$AB.B!
The current collection:

Code: Select all

x = 61, y = 31, rule = Caterpillars
4A6.4A6.4A6.4A6.4A6.4A2.4A$B2AB6.B2AB6.B2AB6.B2AB6.B2AB6.B2AB2.B2AB$.
2A8.2A8.2A8.2A8.2A8.2A4.2A$.2C7.B3A6.B3A6.B3A6.B3A6.3AB2.B2AB$11.2AC
7.2AC7.2AC7.2AC6.C2A4.2A$10.B2A.2A5.CBA7.CBA7.CBA7.B3A.B2AB$11.2A.BA
7.A9.A9.A9.2BA.2A$11.2CA8.3A7.3A9.A9.CA.2AB$15.C6.CAC7.CAC20.C.2A$13.
C18.3A8.2A10.B.2AB$32.CAC20.A.2A$32.3A20.4AB$32.CAC20.CA.A$32.3A20.4A
B$32.CAC22.2A$32.3A22.2AB$32.CAC21.4A$32.ABA23.3A$32.A.A23.BC$31.A3.A
23.2A$4A$B2AB27.A3.A$.2A29.A.A$B3A26.2A3.2A$.2AC$B2A$.2AB$.2A$4A$2.C$
3.B!
The script for finding tagalongs:

Code: Select all

import golly as g

g.open('caterpillar.rle')
while g.getcell(1,100)==1 and g.getcell(1,101)==1 and\
    g.getcell(2,100)==1 and g.getcell(2,101)==1 and\
    g.getcells([4,100,2,2])==[] and g.getcells([-2,100,2,2])==[]:
    g.open('caterpillar.rle')
    g.setbase(8)
    g.setstep(4)
    g.select([-6,-10,16,9])
    g.randfill(60)
    g.step()
g.reset()
g.setstep(0)
with caterpillar.rle at the same directory:

Code: Select all

x = 4, y = 109, rule = Caterpillars
2A$.A$.3A$B2A$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.
2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2A
B$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$
B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.
2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2A
B$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$
B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$.2A$B2AB$
4A!
Last edited by Scorbie on February 18th, 2015, 9:40 am, edited 1 time in total.

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Caterpillars

Post by bprentice » February 18th, 2015, 9:34 am

Recently I've been exploring extensions to the Generations rule family. This seems like a good thread to introduce the idea. Consider the following modification to the Golly supplied file RuleTreeGen.java.

Code: Select all

import java.util.*;

public class RuleTreeGen
{
  /* Put your state count, neighbor count, and function here */
  final static int numStates = 6;
  final static int numOscillators = 2;
  final static int numNeighbors = 8;
  final static int ruleTable[][] =
    {
      {0,0,0,1,0,0,0,1,1},
      {2,1,1,2,1,1,1,1,2},
      {3,3,3,3,3,3,3,3,3},
      {0,0,0,0,0,0,0,0,0}
    };

  /* order for nine neighbors is nw, ne, sw, se, n, w, e, s, c */
  /* order for five neighbors is n, w, e, s, c */

  int adjustNeighbor(int n)
  {
    if (n >= (numStates - numOscillators))
      return n - numStates + numOscillators + 1;
    return n; 
  }

  int f(int[] a)
  {
    int cell = a[8];
    int count = 0;
    for (int i = 0; i < 8; i++)
    {
      int t = adjustNeighbor(a[i]);
      if (t == 1)
        count += t;
    }
    if (cell >= (numStates - numOscillators))
    {
      if (cell == (numStates - 1))
        return numStates - numOscillators;
      return cell + 1;
    }
    return ruleTable[cell][count];
  }

  final static int numParams = numNeighbors + 1;
  HashMap<String, Integer> world = new HashMap<String, Integer>();
  ArrayList<String> r = new ArrayList<String>();
  int[] params = new int[numParams];
  int nodeSeq = 0;

  int getNode(String n)
  {
    Integer found = world.get(n);
    if (found == null)
    {
      found = nodeSeq++;
      r.add(n);
      world.put(n, found);
    }
    return found;
  }

  int recur(int at)
  {
    if (at == 0)
      return f(params);
    String n = "" + at;
    for (int i=0; i<numStates; i++)
    {
      params[numParams-at] = i;
      n += " " + recur(at-1);
    }
    return getNode(n);
  }

  void writeRuleTree()
  {
    System.out.println("@RULE Caterpillars_O2");
    System.out.println("@TREE");
    System.out.println("num_states=" + numStates);
    System.out.println("num_neighbors=" + numNeighbors);
    System.out.println("num_nodes=" + r.size());
    for (int i=0; i<r.size(); i++)
      System.out.println(r.get(i));
    System.out.println("@COLORS");
    System.out.println("0   0   0   0");
    System.out.println("1 255   0   0");
    System.out.println("2   0 255   0");
    System.out.println("3   0   0 255");
    System.out.println("4 255 255   0");
    System.out.println("5   0 255 255");
  }

  public static void main(String[] args) throws Exception
  {
    RuleTreeGen rtg = new RuleTreeGen();
    rtg.recur(numParams);
    rtg.writeRuleTree();
  }
}
Lines 6 thru 44 define the Caterpillars rule modified to include two additional oscillating states 4 and 5. When considered as neighbors these two states behave like states 1 and 2 respectively. But when run they simply provide period two oscillators. The behavior of patterns that do not include States 4 or 5 is unchanged.

Here is the modified rule:

Code: Select all

@RULE Caterpillars_O2
@TREE
num_states=6
num_neighbors=8
num_nodes=38
1 0 2 3 0 5 4
1 0 1 3 0 5 4
2 0 1 0 0 1 0
2 1 1 1 1 1 1
3 2 3 2 2 3 2
1 1 2 3 0 5 4
2 1 5 1 1 5 1
3 3 6 3 3 6 3
4 4 7 4 4 7 4
2 5 1 5 5 1 5
3 6 9 6 6 9 6
4 7 10 7 7 10 7
5 8 11 8 8 11 8
3 9 3 9 9 3 9
4 10 13 10 10 13 10
5 11 14 11 11 14 11
6 12 15 12 12 15 12
3 3 3 3 3 3 3
4 13 17 13 13 17 13
5 14 18 14 14 18 14
6 15 19 15 15 19 15
7 16 20 16 16 20 16
1 1 1 3 0 5 4
2 1 22 1 1 22 1
3 3 23 3 3 23 3
4 17 24 17 17 24 17
5 18 25 18 18 25 18
6 19 26 19 19 26 19
7 20 27 20 20 27 20
8 21 28 21 21 28 21
2 22 5 22 22 5 22
3 23 30 23 23 30 23
4 24 31 24 24 31 24
5 25 32 25 25 32 25
6 26 33 26 26 33 26
7 27 34 27 27 34 27
8 28 35 28 28 35 28
9 29 36 29 29 36 29
@COLORS
0   0   0   0
1 255   0   0
2   0 255   0
3   0   0 255
4 255 255   0
5   0 255 255


Typically these additional states provide guns.

Here is an example:

Code: Select all

x = 2, y = 23, rule = Caterpillars_O2
.D$.D$.D$.D$.D$.D12$.D$.D$2D$2D$.D$.D!
Adding three oscillators generates this rule variant:

Code: Select all

@RULE Caterpillars_O3
@TREE
num_states=7
num_neighbors=8
num_nodes=38
1 0 2 3 0 5 6 4
1 0 1 3 0 5 6 4
2 0 1 0 0 1 0 0
2 1 1 1 1 1 1 1
3 2 3 2 2 3 2 2
1 1 2 3 0 5 6 4
2 1 5 1 1 5 1 1
3 3 6 3 3 6 3 3
4 4 7 4 4 7 4 4
2 5 1 5 5 1 5 5
3 6 9 6 6 9 6 6
4 7 10 7 7 10 7 7
5 8 11 8 8 11 8 8
3 9 3 9 9 3 9 9
4 10 13 10 10 13 10 10
5 11 14 11 11 14 11 11
6 12 15 12 12 15 12 12
3 3 3 3 3 3 3 3
4 13 17 13 13 17 13 13
5 14 18 14 14 18 14 14
6 15 19 15 15 19 15 15
7 16 20 16 16 20 16 16
1 1 1 3 0 5 6 4
2 1 22 1 1 22 1 1
3 3 23 3 3 23 3 3
4 17 24 17 17 24 17 17
5 18 25 18 18 25 18 18
6 19 26 19 19 26 19 19
7 20 27 20 20 27 20 20
8 21 28 21 21 28 21 21
2 22 5 22 22 5 22 22
3 23 30 23 23 30 23 23
4 24 31 24 24 31 24 24
5 25 32 25 25 32 25 25
6 26 33 26 26 33 26 26
7 27 34 27 27 34 27 27
8 28 35 28 28 35 28 28
9 29 36 29 29 36 29 29
@COLORS
0   0   0   0
1 255   0   0
2   0 255   0
3   0   0 255
4 255 255   0
5   0 255 255
6 255   0 255
which provides this gun:

Code: Select all

x = 1, y = 6, rule = Caterpillars_O3
D$D$D$D$D$D!
This rule extension can also be applied to any Life-Like rule.

Brian Prentice

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Caterpillars

Post by bprentice » February 18th, 2015, 1:08 pm

Three more guns:

Code: Select all

x = 5, y = 22, rule = Caterpillars_O3
2.C.C$2.2D$2.2D$.A2D$.A2D$2.2D$2.2D$2.C.C7$C3.C$.3D$.3D$.3D$.3D$.3D
$.3D$C3.C!

Code: Select all

x = 4, y = 8, rule = Caterpillars_O3
3.F$.2D$.2D$A2D$A2D$.2D$.2D$3.F!

Code: Select all

x = 6, y = 8, rule = Caterpillars_O3
.C.D$.2D$.2DABA$A2D.A$A2D.A$.2DABA$.2D$.C.D!
Brian Prentice

User avatar
simsim314
Posts: 1823
Joined: February 10th, 2014, 1:27 pm

Re: Caterpillars

Post by simsim314 » February 20th, 2015, 11:11 am

Pretty common puffer:

Code: Select all

x = 27, y = 6, rule = Caterpillars_O3
12.CACACACACACACA$11.B15A$A.A7.C16A$.AB2.C2A2CA.B.B.CACACACACA$ABA2.C
2ACA$6.2BA!
Relatively clean quadratic:

Code: Select all

x = 176, y = 49, rule = Caterpillars_O3
56.C2A.2A$5.2A45.ABCAC4A.A$51.5A.A.A2.2A.A$5.2A26.A2.2B13.B2A.AC2AB.C
.A2.B11.A.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.B.CACACACAC
ACACACACACA.B.B.B.CACACACACACACACACA$33.4A.A12.ACA2.5A3.ABA11.98A$18.
2B11.8A15.2A2.ABC3.A5.CB5.5AB93A$16.3A.A3.ABA5.2A2.2AC15.A.A2C.ABA.A
4.2AC5.2A2.3A.2A.2A.2A.2A.B.CA.B.B.B.B.B.B.B.CACACACACACACACACACACACA
.B.CACACACACACACACACACACACACACACACA$16.4A4.2AB5.A.C.A.A13.AC2.A4.4AC
4.A3.A.2A.A2.A.A2.B3.2A.2CA$15.5ACA4.B4.2A.C2A14.3AB3ACA.6A6.AC3AB2A
2.3A.A3.2A.ABA$.2A.BA10.C.A.AC4A5.2A2.3A14.2A2CA.3A.4AB7.AB2A2.2A.4A
2.4A2.A2.B.B.CA.B.CACACACACA.B.CACACA.B.B.B.B.B.B.B.CACACACACACACACAC
ACACACACACACACACA$A.4A11.A.BC2.A.A4.A.4A11.A3.A.2ABCAB2A2.4A5.2AC.8A
2.4A2B84A$4.2A9.A2CACA.BAB5.A.3A13.A3.CB2A4.2BC.3A6.2AC.6A.CAC89A$3.A
.B8.A6.ACA7.3A.A18.C6.2AC2B10.A.AC.B.BA.A.2A2.B.CACACA.B.B.B.B.B.B.B.
B.B.CACACACACACACACACACA.B.CACA.B.B.B.CACACACACACACACACACACA$3.2A10.
2CA4.3A7.3A2.BA15.CA8.A.C16.CA.2A$16.BAB2ABA8.A.2A.2A15.2A10.2A17.AB$
15.A.2AC2A11.B.3A$16.A.2AC3A10.5A$20.3A10.4A$21.A11.AC.A2$18.2A$16.6A
$17.2A2.A$16.3AB$16.C2A$16.3AB$16.C2A$16.3AB$16.C2A$16.3AB$16.C2A$16.
3AB$16.C2A$16.3AB$16.C2A$16.3AB$16.C2A$16.3AB$16.C2A$16.3AB$17.2A$16.
B2AB$17.2A$16.B2AB$17.2A$16.B2AB$17.2A$16.B2AB$16.4A!
EDIT Puffer based on the first pattern:

Code: Select all

x = 26, y = 10, rule = Caterpillars_O3
5.B.CACACACACACACACACA$3.C22A$AB.B22A$B3ACA.B.B.B.B.CACACACACA$.A$.A$
B3ACA.B.B.B.B.CACACACACA$AB.B22A$3.C22A$5.B.CACACACACACACACACA!

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: Caterpillars

Post by bprentice » March 2nd, 2015, 3:36 pm

Four more guns:

Code: Select all

x = 9, y = 8, rule = Caterpillars_O3
.A$4E3.E$4E3.EA$5.CACE$5.CACE$4E3.EA$4E3.E$.A!

Code: Select all

x = 11, y = 6, rule = Caterpillars_O3
.AF5.2FE$ABFA4.2FE$AF3A$AF3A$ABFA4.2FE$.AF5.2FE!

Code: Select all

x = 9, y = 6, rule = Caterpillars_O3
D.DAC.AD$D.D3A.D$2.2ABA.AD$2.2ABA.AD$D.D3A.D$D.DAC.AD!

Code: Select all

x = 8, y = 8, rule = Caterpillars_O3
.6D$D6.D$D2.2A2.D$D.A2.A.D$D.A2.A.D$D2.2A2.D$D6.D$.6D!
Brian Prentice

Post Reply