One-dimensional cellular automata: Difference between revisions

Content added Content deleted
m (fix bare lang tags)
Line 353: Line 353:
do { printf(c + 1); } while (evolve(c + 1, b + 1, sizeof(c) - 3));
do { printf(c + 1); } while (evolve(c + 1, b + 1, sizeof(c) - 3));
return 0;
return 0;
}</lang>output<lang>###_##_#_#_#_#__#__
}</lang>output
<pre>###_##_#_#_#_#__#__
#_#####_#_#_#______
#_#####_#_#_#______
_##___##_#_#_______
_##___##_#_#_______
Line 361: Line 362:
_##____#_#_________
_##____#_#_________
_##_____#__________
_##_____#__________
_##________________</lang>
_##________________</pre>


Similar to above, but without a backup string:
Similar to above, but without a backup string:
Line 743: Line 744:
MAIN: main-cellular
MAIN: main-cellular
</lang>
</lang>
<lang>( scratchpad ) "cellular" run
<pre>( scratchpad ) "cellular" run
_###_##_#_#_#_#__#__
_###_##_#_#_#_#__#__
_#_#####_#_#_#______
_#_#####_#_#_#______
Line 754: Line 755:
__##________________
__##________________
__##________________
__##________________
__##________________</lang>
__##________________</pre>


=={{header|Fantom}}==
=={{header|Fantom}}==
Line 1,648: Line 1,649:
Output:
Output:


<lang>_###_##_#_#_#_#__#__
<pre>_###_##_#_#_#_#__#__
_#_#####_#_#_#______
_#_#####_#_#_#______
__##___##_#_#_______
__##___##_#_#_______
Line 1,656: Line 1,657:
__##____#_#_________
__##____#_#_________
__##_____#__________
__##_____#__________
__##________________</lang>
__##________________</pre>


=={{header|PicoLisp}}==
=={{header|PicoLisp}}==
Line 2,035: Line 2,036:
(display-evolution (list 1 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 1 0) 10)</lang>
(display-evolution (list 1 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 1 0) 10)</lang>
Output:
Output:
<lang>(1 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 1 0)
<pre>(1 1 1 0 1 1 0 1 0 1 0 1 0 1 0 0 1 0)
(1 0 1 1 1 1 1 0 1 0 1 0 1 0 0 0 0 0)
(1 0 1 1 1 1 1 0 1 0 1 0 1 0 0 0 0 0)
(0 1 1 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0)
(0 1 1 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0)
Line 2,044: Line 2,045:
(0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0)
(0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0)
(0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
(0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
(0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)</lang>
(0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)</pre>


=={{header|Seed7}}==
=={{header|Seed7}}==