Home  •  LifeWiki  •  Forums  •  Download Golly

## Another ant-based cellular automata

A forum where anything goes. Introduce yourselves to other members of the forums, discuss how your name evolves when written out in the Game of Life, or just tell us how you found it. This is the forum for "non-academic" content.

### Another ant-based cellular automata

https://codepen.io/anon/pen/vvqNqg
These rule makes mysterious path!

PHPBB12345

Posts: 483
Joined: August 5th, 2015, 11:55 pm

### Re: Another ant-based cellular automata

the step function:
`function next_step(){   var dx = x_shift[ant_d];   var dy = y_shift[ant_d];   var cx = (ant_x+dx+w)%w;   var cy = (ant_y+dy+h)%h;      var a = cy*w+cx;   var s = currc[a];   if (s)      ant_d = (ant_d + 3) % 4   else      ant_d = (ant_d + 1) % 4   currc[ant_y*w+ant_x] = 1 - s;   ant_x = cx;   ant_y = cy;`

declarations:
`var ant_x = (w / 2) | 0;var ant_y = (h / 2) | 0;var ant_d = 0;var currc = new Uint8Array(w*h);var x_shift = [1,0,-1,0];var y_shift = [0,1,0,-1];`

after analysis, the rule seems to:
write down the next position as cx and cy,
change the direction similar to langton's ant,
toggle the cell at cx and cy,
move to cx and cy,
repeat.

simplification leaves this:
flip cell,
change direction according to cell behind,
move forward,
repeat.

which is basically:
langton's ant but it looks behind instead of under.
c(>^x^<c)~
This is Fluffy the cat.
Fluffy wants to discover new things that everyone likes.
Fluffy likes to watch spaceship guns in Golly.

There’s one problem,

Fluffy doesn’t exist :(

Redstoneboi

Posts: 317
Joined: May 14th, 2018, 3:57 am

Return to The Sandbox

### Who is online

Users browsing this forum: blah, Hdjensofjfnen and 1 guest