Elementary cellular automaton: Difference between revisions
Content added Content deleted
(jq) |
(→{{header|jq}}: fix typos) |
||
Line 1,032: | Line 1,032: | ||
if $n == 0 then .[-1:] + .[0:2] |
if $n == 0 then .[-1:] + .[0:2] |
||
elif $n == (length-1) then .[-2:] + .[0:1] |
elif $n == (length-1) then .[-2:] + .[0:1] |
||
else .[n-1:n+2] |
else .[$n-1:$n+2] |
||
end; |
end; |
||