is pretty cool so I made a rule table for it.
The rules are as follows:
1. There are sets of 'cars' going right, and going down, typically on a torus.
2. The cars going right and down take turns.
3. During a turn, if a car that's supposed to move isn't blocked by another car it does. Otherwise it stays put.
Note that because of the 'take turns' stipulation there are 4 states instead of 2: a white icon indicates that the car is waiting. Hence each pattern should consist only of states 0,1, and 2 or 0,3, and 4 to run properly.
The rule table is here:
Code: Select all
@RULE traffic
@TABLE
n_states:5
neighborhood:vonNeumann
symmetries:none
#0: nothing
#1: car moving right
#2: car moving down waiting
#3: car moving down
#4: car moving right waiting
var a = {0,1,2,3,4}
var b = {0,1,2,3,4}
var c = {0,1,2,3,4}
var d = {0,1,2,3,4}
#cars
var e = {1,2,3,4}
var f = {1,2,3,4}
2,a,b,c,d,3
4,a,b,c,d,1
3,a,b,0,d,0
3,a,b,e,c,2
1,a,0,b,c,0
1,a,e,b,c,4
0,3,a,b,c,2
0,a,b,c,1,4
@COLORS
0 255 255 255
1 255 0 0
2 0 0 255
3 0 0 255
4 255 0 0
@ICONS
XPM
/* width height num_colors chars_per_pixel */
"7 28 4 1"
/* colors */
". c #303030"
"B c #FF0000"
"C c #FFFFFF"
"D c #0000FF"
/* icon for state 1 */
"......."
"...B..."
"...BB.."
".BBBBB."
"...BB.."
"...B..."
"......."
/* icon for state 2 */
"......."
"...C..."
"...C..."
".CCCCC."
"..CCC.."
"...C..."
"......."
/* icon for state 3 */
"......."
"...D..."
"...D..."
".DDDDD."
"..DDD.."
"...D..."
"......."
/* icon for state 4 */
"......."
"...C..."
"...CC.."
".CCCCC."
"...CC.."
"...C..."
"......."