Jump to content

One-dimensional cellular automata: Difference between revisions

m
Line 2,820:
<lang Mathematica>CellularAutomaton[{{0,0,_}->0,{0,1,0}->0,{0,1,1}->1,{1,0,0}->0,{1,0,1}->1,{1,1,0}->1,{1,1,1}->0},{{1,1,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1},0},12]
Print @@@ (% /. {1 -> "#", 0 -> "."});</lang>
For succinctness, an integral rule can be used:
<lang Mathematica>CellularAutomaton[2^^01101000 (* == 104 *), {{1,1,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1}, 0}, 12];</lang>
{{out}}
<lang Mathematica>###.##.#.#.#.#..#
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.