Another approach is to precompute the neighborhoods and do a lookup.
This is more efficient, with a simple life step, but not so youtube-
friendly.
F:"1"=(
" ";
" ";
" ";
" ";
" ";
" ";
" 11 ";
" 11 ";
" 1 ";
" ";
" ";
" ";
" ";
" ";
" "
)
lifeSH:{0<x+0 1@4-2 sum/2(1 0 -1 rotate'\:)/x} / Swee Heng
/ life by lookup:
t:0b vs ' til "i"$2 xexp 9
ctr:t[;27]
cnt:sum each t
trans:(cnt=3) or (ctr=1) and cnt=4
lifeinit:{
r:count x;c:count first x;
index::raze each raze 2 (1 0 -1 rotate'\:)/ (r,c) # til r*c;
raze x}
life:{trans 2 sv x index} / single step
liferun:{(life\) lifeinit x}
-----------------
count liferun F
383
(liferun F) ~ raze each (lifeSH\)F
1b
\t do[20;liferun F]
277
\t do[20;(lifeSH\) F]
1511