method will_live(int $y, int $x) returns bool { my $offsets = [-1|0|+1 , -1|0|+1] & none([0,0]); my @neighbors = ($offsets >>+<< [$y,$x]).states; my @cells = @neighbors.map {@.grid[$_[0]][$_[1]]}; my $alive = @cells.sum; @.grid[$y][$x] ?? $alive == 2|3 :: $alive == 3; }