One-dimensional cellular automata: Difference between revisions
Content added Content deleted
Line 2,820: | 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] |
<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> |
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}} |
{{out}} |
||
<lang Mathematica>###.##.#.#.#.#..# |
<lang Mathematica>###.##.#.#.#.#..# |