4 ms·
Conway's Game of Life in Q: life:{3=a-x*4=a:2(sum -1 0 1 rotate\:,’/)/x}
by anonfunction 9y ago
Conway's Game of Life in Q:
life:{3=a-x*4=a:2(sum -1 0 1 rotate\:,’/)/x}
- abraae 9y agoBy comparison in APL: life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
- LfLxfxxLxfxx 9y agolife←{≢⍸⍵}⌺3 3∊¨3+0,¨⊢ https://youtu.be/3FjYly2G_QI?t=565 https://youtu.be/3FjYly2G_QI?t=565
- RodgerTheGreat 9y agoI think I've nearly convinced Arthur to include an equivalent to "stencil" in k7. Fingers crossed!
- Avshalom 9y agoK's approach of arrays of arrays would preclude an efficient 2d stencil operation wouldn't it?