One-dimensional cellular automata: Difference between revisions

no edit summary
(Grouping BASIC dialects)
No edit summary
Line 379:
Generation 8 __##________________
</pre>
 
=={{header|Amazing Hopper}}==
Amazing Hopper flavour "BASICO", in spanish.
<syntaxhighlight lang="c">
#include <basico.h>
 
algoritmo
tamaño de pila 25
x = 0
enlistar '0,1,1,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,0,0', mover a 'x'
x2 = x
decimales '0', token.separador ("")
iterar para ( k=1, #(k<=10), ++k )
imprimir ' #(utf8("Generación #")),k, "\t", x, NL '
iterar para ( j=2, #(j<20), ++j )
#(x2[j] = 0)
cuando ( #( (x[j-1]+x[j]+x[j+1])==2 ) ){
#(x2[j]=1)
}
siguiente
x = x2
siguiente
terminar
</syntaxhighlight>
{{out}}
<pre>
Generación #1 011101101010101001000
Generación #2 010111110101010000000
Generación #3 001100011010100000000
Generación #4 001100011101000000000
Generación #5 001100010110000000000
Generación #6 001100001110000000000
Generación #7 001100001010000000000
Generación #8 001100000100000000000
Generación #9 001100000000000000000
Generación #10 001100000000000000000
</pre>
 
 
=={{header|Arturo}}==
543

edits