Multi-state Day & Night

For discussion of other cellular automata.
Post Reply
Caenbe
Posts: 52
Joined: September 20th, 2016, 4:24 pm
Location: USA

Multi-state Day & Night

Post by Caenbe » November 25th, 2016, 6:45 pm

Code: Select all

@RULE DayNight16

@TABLE

n_states:16
neighborhood:Moore
symmetries:permute
var a={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}
var b=a
var c=a
var d=a
var e=a
var f=a
var g=a
var h=a
a,a,a,a,a,a,a,b,c,a
a,a,a,a,a,a,b,b,c,b
a,a,a,a,b,c,d,e,f,a
a,b,b,b,b,b,c,d,e,b
a,b,b,b,b,c,c,c,c,a
a,b,b,b,b,c,d,e,f,b
a,b,b,b,c,c,c,d,e,a
a,b,b,b,c,d,e,f,g,b
a,b,b,c,c,d,e,f,g,a
a,b,b,c,d,e,f,g,h,b

@COLORS

0 0 0 0 black
1 0 0 170 dark blue
2 0 170 0 dark green
3 0 170 170 dark aqua
4 170 0 0 dark red
5 170 0 170 dark purple
6 250 170 0 gold
7 170 170 170 gray
8 85 85 85 dark gray
9 85 85 255 blue
10 85 255 85 green
11 85 255 255 aqua
12 255 85 85 red
13 255 85 255 light purple
14 255 255 85 yellow
15 255 255 255 white
It hasn't been done already as far as I know, so I decided to make a version of Day & Night with multiple states. This version has 16, but it can easily be extended to any number. Although, I don't know why you would need more than 16.

It works as follows:
- The central cell counts how many neighbors have a different state than its own.
- If the number is 3, 6, 7, or 8, it changes to the state represented by the most of those neighbors.
- If there's a tie, it keeps its current state.

Watch out if you're starting with a random grid of multiple states; it runs really slowly. By the way, in case you don't know about it, I'm using random-fill.py from the Golly Scripts Database to fill grids with an equal distribution.
Music make you lose control
Music make you lose control
echo "print(10**10**5//~-10**1000//9801)" | python | aplay

Post Reply