## Making a rule table...

For discussion of other cellular automata.
12Glider
Posts: 79
Joined: December 17th, 2010, 4:56 pm

### Making a rule table...

Hello. I was wondering if somebody could make a rule table emulating the Triad rule in MCell. Any help will be accepted!
I know the general behavior of the rule, but I am lost as to how to translate it to a .table format.
The rule is behaves exactly the same as Brian's Brain, with 2 colors. States 1 (red) and 3 (blue) are on cells; 2 (dark red) & 4 (dark blue) are dying cells; when 1 and 3 interact, State 5 (Yellow) is produced.

Why hasn't a glider exploded yet?

Extrementhusiast
Posts: 1833
Joined: June 16th, 2009, 11:24 pm
Location: USA

### Re: Making a rule table...

I had this same problem earlier, but I also got help with this. I'm not sure if this is the rule you are specifying, but I'll do my best:

Code: Select all

``````n_states:6
neighborhood:Moore
symmetries:permute

var a={0,1,2,3,4,5}
var b={a}
var c={a}
var d={a}
var e={a}
var f={a}
var g={a}
var h={a}
var i={0,2,4,5}
var j={i}
var k={i}
var L={i}
var m={i}
var n={i}
var o={i}
var p={i}

# Birth
0,1,1,i,j,k,L,m,n,1
0,3,3,i,j,k,L,m,n,3
0,1,3,i,j,k,L,m,n,5

# Survival (none)
1,a,b,c,d,e,f,g,h,2
2,a,b,c,d,e,f,g,h,0
3,a,b,c,d,e,f,g,h,4
4,a,b,c,d,e,f,g,h,0
``````
Save this as triad.rle.

And for the colors:

Code: Select all

``````color = 1 255   0   0
color = 2 128   0   0
color = 3   0   0 255
color = 4   0   0 128
color = 5 255 255   0``````
Save this as triad.colors.
I Like My Heisenburps! (and others)

12Glider
Posts: 79
Joined: December 17th, 2010, 4:56 pm

### Re: Making a rule table...

That's almost exactly what I need! Just one thing though: 5 doesn't act as a still life; it moves with other patterns, and makes them behave differently. Other than that, it's great!
Run this pattern in MCell to see what I mean.

Code: Select all

``````#MCell 4.20
#GAME User DLL
#BOARD 320x240
#WRAP 1
#CCOLORS 6
#D Red and Blue never fought it out this good!
#D
#L 14.CC\$.EE11.DDE\$ABDCE8.C.BE\$AB.CDBE.EE..D\$4.CD.CDBCC\$5.CD..DD\$7.CD.C
``````
You'll see spaceships emitting yellow cells. These spaceships are exhibiting the behavior that I seek with 1,3,& 5.
Last edited by 12Glider on April 13th, 2011, 7:00 pm, edited 1 time in total.

Why hasn't a glider exploded yet?

12Glider
Posts: 79
Joined: December 17th, 2010, 4:56 pm

### Re: Making a rule table...

I did find a nice line stretcher though.

Code: Select all

``````x = 23, y = 49, rule = Triad
15.BA\$15.BA\$8.B2.B2.A\$7.A5.BA\$.B6.BA2B3.B2.BA\$2A7.A3.2B2.2A.BA\$.B.B7.
B2.2A2.BA.BA\$2.A13.BA3.BA\$14.BA\$12.BA\$B3.A.BA2.BA\$2.2A2B2.BA\$.2B3.BA\$
4.BA\$2.BA\$.BA18\$.DC\$2.DC\$4.DC\$.2D3.DC\$2.2C2D2.DC\$D3.C.DC2.DC\$12.DC\$
14.DC\$2.C13.DC3.DC\$.D.D7.D2.2C2.DC.DC\$2C7.C3.2D2.2C.DC\$.D6.DC2D3.D2.D
C\$7.C5.DC\$8.D2.D2.C\$15.DC\$15.DC!
``````

Why hasn't a glider exploded yet?

Extrementhusiast
Posts: 1833
Joined: June 16th, 2009, 11:24 pm
Location: USA

### Re: Making a rule table...

That is actually FAR TOO LARGE! It's actually so small that I could fit it in an ASCII:

Code: Select all

``````42
42
55
31
31``````
Perhaps you meant this?

Code: Select all

``````n_states:6
neighborhood:Moore
symmetries:permute

var a={0,1,2,3,4,5}
var b={a}
var c={a}
var d={a}
var e={a}
var f={a}
var g={a}
var h={a}
var i={0,2,4}
var j={i}
var k={i}
var L={i}
var m={i}
var n={i}
var o={i}
var p={i}

# Birth
0,1,1,i,j,k,L,m,n,1
0,3,3,i,j,k,L,m,n,3
0,1,3,i,j,k,L,m,n,5
0,1,5,i,j,k,L,m,n,1
0,3,5,i,j,k,L,m,n,3

# Survival (none)
1,a,b,c,d,e,f,g,h,2
2,a,b,c,d,e,f,g,h,0
3,a,b,c,d,e,f,g,h,4
4,a,b,c,d,e,f,g,h,0``````
Or perhaps this?

Code: Select all

``````n_states:6
neighborhood:Moore
symmetries:permute

var a={0,1,2,3,4,5}
var b={a}
var c={a}
var d={a}
var e={a}
var f={a}
var g={a}
var h={a}
var i={0,2,4,5}
var j={i}
var k={i}
var L={i}
var m={i}
var n={i}
var o={i}
var p={i}

# Birth
0,1,1,i,j,k,L,m,n,1
0,3,3,i,j,k,L,m,n,3
0,1,3,i,j,k,L,m,n,5
0,1,5,i,j,k,L,m,n,1
0,3,5,i,j,k,L,m,n,3

# Survival (none)
1,a,b,c,d,e,f,g,h,2
2,a,b,c,d,e,f,g,h,0
3,a,b,c,d,e,f,g,h,4
4,a,b,c,d,e,f,g,h,0``````
I Like My Heisenburps! (and others)

flipper77
Posts: 197
Joined: October 24th, 2010, 3:25 am
Location: Spokane, WA

### Re: Making a rule table...

Perhaps you meant this?

Code: Select all

``````n_states:6
neighborhood:Moore
symmetries:permute

var a={0,1,2,3,4,5}
var b={a}
var c={a}
var d={a}
var e={a}
var f={a}
var g={a}
var h={a}
var i={0,2,4}
var j={i}
var k={i}
var L={i}
var m={i}
var n={i}
var o={i}
var p={i}

# Birth
0,1,1,i,j,k,L,m,n,1
0,3,3,i,j,k,L,m,n,3
0,1,3,i,j,k,L,m,n,5
0,1,5,i,j,k,L,m,n,1
0,3,5,i,j,k,L,m,n,3

# Survival (none)
1,a,b,c,d,e,f,g,h,2
2,a,b,c,d,e,f,g,h,0
3,a,b,c,d,e,f,g,h,4
4,a,b,c,d,e,f,g,h,0``````
Or perhaps this?

Code: Select all

``````n_states:6
neighborhood:Moore
symmetries:permute

var a={0,1,2,3,4,5}
var b={a}
var c={a}
var d={a}
var e={a}
var f={a}
var g={a}
var h={a}
var i={0,2,4,5}
var j={i}
var k={i}
var L={i}
var m={i}
var n={i}
var o={i}
var p={i}

# Birth
0,1,1,i,j,k,L,m,n,1
0,3,3,i,j,k,L,m,n,3
0,1,3,i,j,k,L,m,n,5
0,1,5,i,j,k,L,m,n,1
0,3,5,i,j,k,L,m,n,3

# Survival (none)
1,a,b,c,d,e,f,g,h,2
2,a,b,c,d,e,f,g,h,0
3,a,b,c,d,e,f,g,h,4
4,a,b,c,d,e,f,g,h,0``````
Neither of these are rule tables exhibit the same behavior as the one 12Glider is referring to. From what I've seen, any state 5 cells that are born one generation die immediately after.

Extrementhusiast
Posts: 1833
Joined: June 16th, 2009, 11:24 pm
Location: USA

### Re: Making a rule table...

(I don't use MCell, so that's why I'm having trouble figuring out the exact rule.) From flipper77's description, here is another table:

Code: Select all

``````n_states:6
neighborhood:Moore
symmetries:permute

var a={0,1,2,3,4,5}
var b={a}
var c={a}
var d={a}
var e={a}
var f={a}
var g={a}
var h={a}
var i={0,2,4}
var j={i}
var k={i}
var L={i}
var m={i}
var n={i}
var o={i}
var p={i}

# Birth
0,1,1,i,j,k,L,m,n,1
0,3,3,i,j,k,L,m,n,3
0,1,3,i,j,k,L,m,n,5

# Survival (none)
1,a,b,c,d,e,f,g,h,2
2,a,b,c,d,e,f,g,h,0
3,a,b,c,d,e,f,g,h,4
4,a,b,c,d,e,f,g,h,0
5,a,b,c,d,e,f,g,h,0``````
Surprisingly, the second variation that I posted can emulate Wireworld, as far as I know. Here is an XOR gate:

Code: Select all

``````x = 20, y = 33, rule = (rulename)
7E\$EBA3.2E\$6E.E\$5.E.E\$4.2E.3E\$4.E4.11E\$4.E.2E11.E\$4.E4.11E\$4.2E.3E\$5.
E.E\$6E.E\$EBA3.2E\$7E8\$7E\$E2B3.2E\$6E.E\$5.E.E\$4.2E.3E\$4.E4.11E\$4.E.2E11.
E\$4.E4.11E\$4.2E.3E\$5.E.E\$6E.E\$EBA3.2E\$7E!
``````
In the same variation, here is an unstable wickstretcher base:

Code: Select all

``````x = 18, y = 14, rule = (rulename)
.A14.A\$A16EA\$2A.B3A.2B.3AB.2A\$.2BA2.B.2B.B2.A2B\$.A4.AB2.BA4.A\$7.A2.A\$
6.B4.B\$6.AB2.BA\$7.A2.A\$6.B4.B\$6.AB2.BA\$7.A2.A\$8.2B\$8.2A!
``````
I Like My Heisenburps! (and others)

flipper77
Posts: 197
Joined: October 24th, 2010, 3:25 am
Location: Spokane, WA

### Re: Making a rule table...

This one doesn't work right either. Try downloading the setup for MCell from this site by clicking the "MCell setup" link, and install it, then after it's all set up, then copy and paste the MCell pattern above in 12Glider's last post by going to File > Open Special > Open from clipboard.

Extrementhusiast
Posts: 1833
Joined: June 16th, 2009, 11:24 pm
Location: USA

### Re: Making a rule table...

Is this simply a three-colored variation on Brian's Brain?

Since this is taking such a long time, I'll just provide the general format. (I also do not wish to download MCell just to look at a particular rule.) First, start with this "heading":

Code: Select all

``````n_states:6
neighborhood:Moore
symmetries:permute``````
This assumes that there are five ON states and one OFF state, that it is in the Moore neighborhood (like the original Brian's Brain), and that any rearrangement of a specific cell's neighbors generates the same central cell one generation later (also like the original Brian's Brain). To comment out a line, insert a number sign, a space, and the comment, like this:

Code: Select all

``# This is an example comment.``
Now comes the harder part.

There are actually two different parts. The first part is the general cellstate-change rules. To do this, insert this in:

Code: Select all

``center-start,01,02,03,04,05,06,07,08,center-end``
Replace "center-start" with the cellstate that you want to change. Replace "center-end" with the final result. Replace "01"-"08" with whatever cells are needed to change the cell from the "center-start" cellstate to the "center-end" cellstate. This will most likely be confusing, so I'll give an example:

Code: Select all

``0,1,2,0,0,0,0,0,0,3``
This means that a cell of state 0 (empty) needs one cell of state 1 and one cell of state 2, and six cells of state 0, to change to state 3. Multiple changes can be implemented for the same cellstate, as in this example of 3-4 Life:

Code: Select all

``````0,1,1,1,0,0,0,0,0,1
0,1,1,1,1,0,0,0,0,1``````
One more thing: if a cell in the final rule does not satisfy any condition (like if there are five live neighbors around a dead cell in 3-4 Life), it stays the same.

Now for the second part. If a neighbor can be any value out of a particular set of values, do something like this, as in another example from 3-4 Life:

Code: Select all

``````var a={0,1}
0,1,1,1,a,0,0,0,0,1``````
You could even define something as crazy as this:

Code: Select all

``var a={2,5,7,8,11}``
This would mean that in the cellstate-change condition, a particular neighbor can be any of states 2, 5, 7, 8, or 11, but none others.If there are multiple cellstate sets, use a different sequence of letter without spaces after "var", like this:

Code: Select all

``````var a={0,1,3}
var b={1,2,7}
var ab={0,1,2,3,7}``````
If there is more than one of the same variation needed, do something like this (from LongLife, B345/S5):

Code: Select all

``````var a={0,1}
var b={a}
0,1,1,1,a,b,0,0,0,1``````
One more thing: I tend to use a capital L instead of a lowercase l, because in my computer's font, the "l" and the "1" look identical. I hope this explanation was easy enough for you to understand, and yet thorough enough to cover your future rule-table-making adventures.
Last edited by Extrementhusiast on April 14th, 2011, 3:55 pm, edited 1 time in total.
I Like My Heisenburps! (and others)

12Glider
Posts: 79
Joined: December 17th, 2010, 4:56 pm

### Re: Making a rule table...

This rule is actually a little bit different, in the fact that if the different cells are pack close enough, they make different spaceships.
To demonstrate this, I'll make a little drawing of sorts:
....
.12.
.12.
.... This is the basic block ship in BB. p1.

....
.14.
.12.
.... This is the block ship in Triad, with a state 2 cell being replaced with a state 4 cell. This is actually p2, because a generation later, this appears:

..55
.124
.12.
....

Why hasn't a glider exploded yet?

flipper77
Posts: 197
Joined: October 24th, 2010, 3:25 am
Location: Spokane, WA

### Re: Making a rule table...

I think I got the ruletable right:

Code: Select all

``````n_states:6
neighborhood:Moore
symmetries:permute

var a={0,1,2,3,4,5}
var b={a}
var c={a}
var d={a}
var e={a}
var f={a}
var g={a}
var h={a}
var i={0,1,2,3,4}
var j={i}
var k={i}
var l={i}
var m={i}
var n={i}
var o={i}
var p={i}
var q={0,2,4,5}
var r={q}
var s={q}
var aa={q}
var ab={q}
var ac={q}
var ae={q}
var af={1,2}
var ag={1,3}

#No birth

#Birth
0,ag,ag,q,r,s,aa,ab,ac,ag
0,1,1,3,q,r,s,aa,ab,1
0,3,3,1,q,r,s,aa,ab,3
0,1,3,q,r,s,aa,ab,ac,5
0,1,3,1,3,q,r,s,aa,5

#Survival change
1,5,j,k,l,m,n,o,p,3
3,5,j,k,l,m,n,o,p,1

#Transition
1,a,b,c,d,e,f,g,h,2
3,a,b,c,d,e,f,g,h,4

#Death
q,a,b,c,d,e,f,g,h,0``````
Since this is my first real ruletable, I'm sure this could be compressed further, but I believe it works since it functions the same as in Mcell

EDIT:
Very small p2 oscillator

Code: Select all

``````x = 3, y = 2, rule = Triad
.EA\$C!
``````
EDIT2:
Here's a more compact ruletable

Code: Select all

``````n_states:6
neighborhood:Moore
symmetries:permute

var a={0,1,2,3,4,5}
var b={a}
var c={a}
var d={a}
var e={a}
var f={a}
var g={a}
var h={a}
var i={0,1,2,3,4}
var j={i}
var k={i}
var l={i}
var m={i}
var n={i}
var o={i}
var p={i}
var q={0,2,4,5}
var r={q}
var s={q}
var t={q}
var u={q}
var v={q}
var w={q}
var x={q}
var y={1,2}
var z={1,3}

#Birth
0,z,z,q,r,s,t,u,v,z
0,1,1,3,q,r,s,t,u,1
0,3,3,1,q,r,s,t,u,3
0,1,3,q,r,s,t,u,v,5
0,1,3,1,3,q,r,s,t,5

#Survival change
1,5,j,k,l,m,n,o,p,3
3,5,j,k,l,m,n,o,p,1

#Transition
1,a,b,c,d,e,f,g,h,2
3,a,b,c,d,e,f,g,h,4

#Death
q,a,b,c,d,e,f,g,h,0``````

12Glider
Posts: 79
Joined: December 17th, 2010, 4:56 pm

### Re: Making a rule table...

flipper77 wrote:I think I got the ruletable right:

Code: Select all

``````n_states:6
neighborhood:Moore
symmetries:permute

var a={0,1,2,3,4,5}
var b={a}
var c={a}
var d={a}
var e={a}
var f={a}
var g={a}
var h={a}
var i={0,1,2,3,4}
var j={i}
var k={i}
var l={i}
var m={i}
var n={i}
var o={i}
var p={i}
var q={0,2,4,5}
var r={q}
var s={q}
var aa={q}
var ab={q}
var ac={q}
var ae={q}
var af={1,2}
var ag={1,3}

#No birth

#Birth
0,ag,ag,q,r,s,aa,ab,ac,ag
0,1,1,3,q,r,s,aa,ab,1
0,3,3,1,q,r,s,aa,ab,3
0,1,3,q,r,s,aa,ab,ac,5
0,1,3,1,3,q,r,s,aa,5

#Survival change
1,5,j,k,l,m,n,o,p,3
3,5,j,k,l,m,n,o,p,1

#Transition
1,a,b,c,d,e,f,g,h,2
3,a,b,c,d,e,f,g,h,4

#Death
q,a,b,c,d,e,f,g,h,0``````
Since this is my first real ruletable, I'm sure this could be compressed further, but I believe it works since it functions the same as in Mcell

EDIT:
Very small p2 oscillator

Code: Select all

``````x = 3, y = 2, rule = Triad
.EA\$C!
``````
EDIT2:
Here's a more compact ruletable

Code: Select all

``````n_states:6
neighborhood:Moore
symmetries:permute

var a={0,1,2,3,4,5}
var b={a}
var c={a}
var d={a}
var e={a}
var f={a}
var g={a}
var h={a}
var i={0,1,2,3,4}
var j={i}
var k={i}
var l={i}
var m={i}
var n={i}
var o={i}
var p={i}
var q={0,2,4,5}
var r={q}
var s={q}
var t={q}
var u={q}
var v={q}
var w={q}
var x={q}
var y={1,2}
var z={1,3}

#Birth
0,z,z,q,r,s,t,u,v,z
0,1,1,3,q,r,s,t,u,1
0,3,3,1,q,r,s,t,u,3
0,1,3,q,r,s,t,u,v,5
0,1,3,1,3,q,r,s,t,5

#Survival change
1,5,j,k,l,m,n,o,p,3
3,5,j,k,l,m,n,o,p,1

#Transition
1,a,b,c,d,e,f,g,h,2
3,a,b,c,d,e,f,g,h,4

#Death
q,a,b,c,d,e,f,g,h,0``````
Thanks a bunch! It works exactly how I wanted it!

Why hasn't a glider exploded yet?

flipper77
Posts: 197
Joined: October 24th, 2010, 3:25 am
Location: Spokane, WA

### Re: Making a rule table...

Thank you, but I'm posting an updated version of the ruletable since I found that also 3 and 4 cells of states 1 and 3 produce 5's as well. I added these 2 transitions:

Code: Select all

``````0,1,1,1,3,3,3,s,t,5
0,1,1,1,1,3,3,3,3,5``````
To make this more accurate ruletable:

Code: Select all

``````n_states:6
neighborhood:Moore
symmetries:permute

var a={0,1,2,3,4,5}
var b={a}
var c={a}
var d={a}
var e={a}
var f={a}
var g={a}
var h={a}
var i={0,1,2,3,4}
var j={i}
var k={i}
var l={i}
var m={i}
var n={i}
var o={i}
var p={i}
var q={0,2,4,5}
var r={q}
var s={q}
var t={q}
var u={q}
var v={q}
var w={1,3}

#Birth
0,w,w,q,r,s,t,u,v,w
0,1,1,3,q,r,s,t,u,1
0,3,3,1,q,r,s,t,u,3
0,1,3,q,r,s,t,u,v,5
0,1,1,3,3,q,r,s,t,5
0,1,1,1,3,3,3,s,t,5
0,1,1,1,1,3,3,3,3,5

#Survival change
1,5,j,k,l,m,n,o,p,3
3,5,j,k,l,m,n,o,p,1

#Transition
1,a,b,c,d,e,f,g,h,2
3,a,b,c,d,e,f,g,h,4

#Death
q,a,b,c,d,e,f,g,h,0``````
If you can run Mcell on your computer, you can see the difference when running 90deg_smship_seeds.mcl:

Code: Select all

``````#MCell 4.20
#GAME User DLL