Elementary cellular automaton/Infinite length: Difference between revisions
Elementary cellular automaton/Infinite length (view source)
Revision as of 23:43, 29 September 2019
, 4 years ago→{{header|Julia}}
Line 447:
<lang julia>function ecainfinite(cells, rule, n)
notcell(cell) = (cell == '1') ? '0' : '1'
rulebits = reverse(string(rule, base = 2, pad = 8))
neighbors2next = Dict(string(n - 1, base=2, pad=3) => rulebits[n] for n in 1:8)
|