3
edits
(An implementation and explanation of rule 110) |
m (→Implementation) |
||
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 | 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⍣⍵)⍺} |
edits