M Carneiro
Ohio
Registered: Nov 2009
Posts: 3 |
What you describe cannot be done with a regular cellular automaton in a blank initial condition, because your CA requires a cell to differentiate itself from its neighbors. It can be done, however, if the initial conditions include information for each cell saying "I am cell 2, time step 1" or somesuch. With that setup, this program will suffice:
code: {{2, 17, 99}, {43, 5, 110}}
With[{x = Length[%[[1]]], t = Length[%]},
CellularAutomaton[{c[
IntegerDigits[%[[#[[2, 3]] + 1, #[[2, 2]] + 1]], 2,
8][[FromDigits[#[[All, 1]], 2] + 1]], #[[2, 2]],
Mod[#[[2, 3]] + 1, t]] &, {}, 1},
MapIndexed[
c[#, Mod[#2[[1]] - 1, 3], 0] &, {1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1,
0, 0, 0, 0}], 50]];
ArrayPlot[% /. c[a_, _, _] -> a]
The array at the beginning is the CA rule matrix, and the embedded 0/1 list is the IC. It turns out that your given matrix is quite boring; it always devolves into a 3-by-2 (surprised?) repeating pattern. Interesting patterns generated by random testing:
{{22, 135, 58}, {62, 163, 231}}
{{152, 41, 76}, {120, 74, 90}}
{{146, 221, 135}, {77, 123, 172}}
{{39, 166, 162}, {196, 169, 90}}
{{212, 114, 27}, {154, 153, 10}}
{{54, 183, 37}, {134, 78, 126}}
{{189, 86, 183}, {97, 106, 58}}
{{61, 238, 81}, {101, 101, 233}}
{{158, 95, 225}, {32, 193, 142}}
{{158, 105, 5}, {180, 185, 109}}
Report this post to a moderator | IP: Logged
|