One-dimensional cellular automata: Difference between revisions

→‎Insitux: implementation
imported>Maxima enthusiast
No edit summary
(→‎Insitux: implementation)
Line 2,802:
00110000
-></pre>
 
=={{Header|Insitux}}==
 
<syntaxhighlight lang="insitux">
(function next cells
(... str
(map (comp str (count ["#"]) (= 2) #(% "#" "_"))
(str "_" cells)
cells
(str (skip 1 cells) "_"))))
 
(function generate n cells
(join "\n" (reductions next cells (range n))))
</syntaxhighlight>
 
{{out}}
 
Invoking <code>(generate 9 "_###_##_#_#_#_#__#__")</code>
 
<pre>
_###_##_#_#_#_#__#__
_#_#####_#_#_#______
__##___##_#_#_______
__##___###_#________
__##___#_##_________
__##____###_________
__##____#_#_________
__##_____#__________
__##________________
__##________________
</pre>
 
=={{header|J}}==
112

edits