SP1 Exercise 6 Index   <<   >>


 

The obligatory Game of Life. Create the next generation boolean matrix:

• A 0-cell with 3 neighboring 1-cells becomes a 1.
• A 1-cell with 2 or 3 neighboring 1-cells remains at 1.
• All other cells remain or become a 0.

Assume the universe is bordered on all four sides by 0s.


























See the Dyalog blog http://www.dyalog.com/blog/2017/07/stencil-lives/.

   life ← {3=s-⍵∧4=s←{+/,⍵}⌺3 3⊢⍵}