Created
May 14, 2016 18:19
-
-
Save anonymous/5eb500b89fd6bcad63d35fdaeccd5d8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my @spot = [rand xx 10] xx 10; | |
my @neighbors; | |
for ^10 X ^10 -> ($i, $j) { | |
@neighbors[$i][$j] = eager gather for | |
[-1,-1],[+0,-1],[+1,-1], | |
[-1,+0], [+1,+0], | |
[-1,+1],[+0,+1],[+1,+1] | |
{ | |
take-rw @spot[$i + .[0]][$j + .[1]] // next; | |
} | |
} | |
die "Bogus code" unless @neighbors[1][1][0] === @spot[0][0]; | |
die "Bad decont" unless @neighbors[1][1][0] =:= @spot[0][0]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment