3 ms·
Certainly awesome. Note that this implementation is toroidal. My take on J[1] (code-golfed) based in the same algorithm: l=:[:+/(3 4=/[:+/(,/,"0/~i:1)|.])*.1
by kaoD 13y ago
Certainly awesome. Note that this implementation is toroidal. My take on J[1] (code-golfed) based in the same algorithm:
l=:[:+/(3 4=/[:+/(,/,"0/~i:1)|.])*.1,:]
De-golfed:
life =: [: +/ (3 4 =/ [: +/ (,/ ,"0/~ i:1) |. ]) *. 1 ,: ]
[1] http://www.jsoftware.com http://www.jsoftware.com