Rule:RhombicAnt
@RULE RhombicAnt
https://conwaylife.com/forums/viewtopic.php?p=14102#p14127
Rhombic's Ant moves on a grid of cells with value of either 0, or 1. The ant moves either left or right depending on the state of cell it is on. The ant remembers the state of the cell it moved from. At each turn four cells swap state. These are either the four orthogonally or diagonally adjacent cells, depending on the ant's own state.
Start with all cells off (0) and a single ant facing N. Movement directions have been modified to remove the confusing direction reversal in the original description.
1) Flip cell states:
a) if ant state is 0: swap state of four orthogonally adjacent cells b) if ant state is 1: swap state of four diagonally adjacent cells
2) Ant movement:
a) if ant is in cell with state 0: ant state becomes 0 and move left b) if ant is in cell with state 1: ant state becomes 1 and move right
Ant states format: 0b S A Dir
S: 1 bit indicating current cell state
A: 1 bit indicating ant's remembered state
Dir: Two bits indicating ant's current direction
N: 0b00, E: 0b01, S: 0b10, W: 0b11
States (Background states inserted before 16 ant states):
0 Background cell, state 0 1 Background cell, state 1 2, 3, 4, 5 Current cell state 0, ant state 0 6, 7, 8, 9 Current cell state 0, ant state 1
10,11,12,13 Current cell state 1, ant state 0 14,15,16,17 Current cell state 1, ant state 1
@TREE
num_states=18 num_neighbors=8 num_nodes=65 1 0 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 10 2 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 10 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 14 6 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 6 14 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 0 0 1 2 1 1 3 4 3 3 1 1 1 5 3 3 3 6 1 13 5 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 8 8 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 1 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 5 13 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 11 11 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 17 9 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 14 14 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 9 17 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 16 16 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 7 7 9 10 10 10 12 13 13 13 10 10 15 10 13 13 17 13 3 10 10 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 1 11 3 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 20 20 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 21 21 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 3 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 1 3 11 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 24 24 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 25 25 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 1 15 7 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 27 27 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 28 28 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 1 7 15 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 30 30 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 31 31 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 4 18 18 19 19 22 19 23 23 26 23 29 19 19 19 32 23 23 23 4 19 19 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 1 12 4 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 35 35 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 36 36 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 4 37 37 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 4 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 1 4 12 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 40 40 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 41 41 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 4 42 42 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 1 16 8 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 44 44 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 45 45 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 4 46 46 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 1 8 16 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 48 48 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 49 49 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 4 50 50 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 5 33 33 34 34 34 38 39 39 39 43 34 47 34 34 39 51 39 39 5 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 5 34 34 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 6 52 52 53 53 53 53 54 54 54 54 53 53 53 53 54 54 54 54 6 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 6 54 54 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 53 7 55 55 56 56 56 56 57 57 57 57 56 56 56 56 57 57 57 57 7 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 7 57 57 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 8 58 58 59 59 59 59 60 60 60 60 59 59 59 59 60 60 60 60 8 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 8 60 60 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 9 61 61 62 62 62 62 63 63 63 63 62 62 62 62 63 63 63 63
@TABLE n_states:18 neighborhood:Moore symmetries:none
var a={0,1} var b={a} var c={a} var d={a} var e={a} var f={a} var g={a} var h={a} var i={a}
var ant00 = { 2, 3, 4, 5} var ant01 = { 6, 7, 8, 9} var ant10 = {10,11,12,13} var ant11 = {14,15,16,17}
var ant0X = { 2, 3, 4, 5, 6, 7, 8, 9} # Ant on state 0 cell var ant1X = {10,11,12,13,14,15,16,17} # Ant on state 1 cell var antX0 = { 2, 3, 4, 5,10,11,12,13} # Ant with state 0 var antX1 = { 6, 7, 8, 9,14,15,16,17} # Ant with state 1
- Compact version - doesn't work as expected in Golly 2.7 ?
- var ant0X = {ant00, ant01} # Ant on state 0 cell
- var ant1X = {ant10, ant11} # Ant on state 1 cell
- var antX0 = {ant00, ant10} # Ant with state 0
- var antX1 = {ant00, ant11} # Ant with state 1
- Ant movement
- Swap current state of cell ant moves to when ant state is 0
- Ant to the north
0,5,b,c,d,e,f,g,h,12 0,9,b,c,d,e,f,g,h,4 1,5,b,c,d,e,f,g,h,4 1,9,b,c,d,e,f,g,h,12 0,11,b,c,d,e,f,g,h,16 0,15,b,c,d,e,f,g,h,8 1,11,b,c,d,e,f,g,h,8 1,15,b,c,d,e,f,g,h,16
- Ant to the east
0,a,b,2,d,e,f,g,h,13 0,a,b,6,d,e,f,g,h,5 1,a,b,2,d,e,f,g,h,5 1,a,b,6,d,e,f,g,h,13 0,a,b,12,d,e,f,g,h,17 0,a,b,16,d,e,f,g,h,9 1,a,b,12,d,e,f,g,h,9 1,a,b,16,d,e,f,g,h,17
- Ant to the south
0,a,b,c,d,3,f,g,h,10 0,a,b,c,d,7,f,g,h,2 1,a,b,c,d,3,f,g,h,2 1,a,b,c,d,7,f,g,h,10 0,a,b,c,d,13,f,g,h,14 0,a,b,c,d,17,f,g,h,6 1,a,b,c,d,13,f,g,h,6 1,a,b,c,d,17,f,g,h,14
- Ant to the west
0,a,b,c,d,e,f,4,h,11 0,a,b,c,d,e,f,8,h,3 1,a,b,c,d,e,f,4,h,3 1,a,b,c,d,e,f,8,h,11 0,a,b,c,d,e,f,10,h,15 0,a,b,c,d,e,f,14,h,7 1,a,b,c,d,e,f,10,h,7 1,a,b,c,d,e,f,14,h,15
- Ant always moves
ant0X,a,b,c,d,e,f,g,h,0 ant1X,a,b,c,d,e,f,g,h,1
- Swap state of ant neighbours
- If the ant is moving to this cell, one of the previous rules will match instead
- Ant state is 0 - swap state of orthogonal neighbours
0,antX0,b,c,d,e,f,g,h,1 1,antX0,b,c,d,e,f,g,h,0 0,a,b,antX0,d,e,f,g,h,1 1,a,b,antX0,d,e,f,g,h,0 0,a,b,c,d,antX0,f,g,h,1 1,a,b,c,d,antX0,f,g,h,0 0,a,b,c,d,e,f,antX0,h,1 1,a,b,c,d,e,f,antX0,h,0
- Ant state is 1 - swap state of diagonal neighbours
0,a,antX1,c,d,e,f,g,h,1 1,a,antX1,c,d,e,f,g,h,0 0,a,b,c,antX1,e,f,g,h,1 1,a,b,c,antX1,e,f,g,h,0 0,a,b,c,d,e,antX1,g,h,1 1,a,b,c,d,e,antX1,g,h,0 0,a,b,c,d,e,f,g,antX1,1 1,a,b,c,d,e,f,g,antX1,0
@COLORS
0 0 0 0 1 0 127 0 2 127 0 0 3 127 0 0 4 127 0 0 5 127 0 0 6 127 0 127 7 127 0 127 8 127 0 127 9 127 0 127 10 127 127 0 11 127 127 0 12 127 127 0 13 127 127 0 14 127 127 127 15 127 127 127 16 127 127 127 17 127 127 127