Jump to content

One-dimensional cellular automata: Difference between revisions

m
(→‎{{header|Perl 6}}: remark about wrapping)
Line 2,360:
=={{header|Perl 6}}==
 
We'll make a general algorithm capable of computing any cellular automata as defined by [[wp:Stephen Wolfram|Stephen Wolfram]]'s famous book ''[[wp:A new kind of Science|A new kind of Science]]''. The rule currently proposed for this task is rule 0b01101000 = 104 but it is not particularly interesting so instead we'll show the automata defined by rule[[wp:Rule 90|Rule 90]], which shows a [[wp:Sierpinski Triangle|Sierpinski Triangle]]-like figure. We will also take the liberty of wrapping the array of cells as it does not affect the result much and it makes the implementation a lot easier.
 
<lang perl6>class Automata {
1,934

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.