Rule 110: Difference between revisions

Jump to navigation Jump to search
8 bytes added ,  11:49, 13 March 2022
m
(An implementation and explanation of rule 110)
 
Line 72: Line 72:
I did gloss over an important step, which is to pad the array with a 0 on both sides. This is because any cell that exceeds the bounds is considered dead no matter what, so we need to tell this explicitly to APL.
I did gloss over an important step, which is to pad the array with a 0 on both sides. This is because any cell that exceeds the bounds is considered dead no matter what, so we need to tell this explicitly to APL.


Anyway, now we have a solve function that can calculate the next generation given an array of any size. Now all we need to do is implement a function that can give you generations.
Anyway, now we have a solve function that can calculate the next generation given an array of any size. Now all we need to do is implement a function that can give you a specific generation.
 
 
<source lang="apl">
<source lang="apl">
gen←{(solve⍣⍵)⍺}
gen←{(solve⍣⍵)⍺}
3

edits

Navigation menu