One-dimensional cellular automata: Difference between revisions

Content added Content deleted
(→‎{{header|PureBasic}}: Updated code to PureBasic v5.41 LTS)
Line 3,204: Line 3,204:
Dim nG.i(21)
Dim nG.i(21)
Define.i n, Gen
Define.i n, Gen

DataSection
DataSection
Data.i 0,1,1,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,0
Data.i 0,1,1,1,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,0
Line 3,211: Line 3,211:
Read.i cG(n)
Read.i cG(n)
Next
Next

OpenConsole()
OpenConsole()
Repeat
Repeat
Line 3,227: Line 3,227:
EndIf
EndIf
Next
Next
Swap cG() , nG()
CopyArray(nG(), cG())
Until Gen > 9
Until Gen > 9

PrintN("Press any key to exit"): Repeat: Until Inkey() <> ""</lang>
PrintN("Press any key to exit"): Repeat: Until Inkey() <> ""</lang>
{{out}}
{{out}}