Created
August 28, 2018 06:08
-
-
Save reflash/073439e6ad3f9733c839d5976d232ae8 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
static member NeighboursAt(x : int, y: int, states : int [][]) : int = | |
[for i in [(x-1)..(x+1)] do | |
for j in [(y-1)..(y+1)] do | |
if ((i <> x || j <> y) && | |
Utility.InArrayRange i j states.Length) | |
then yield states.[i].[j];] | |
|> Utility.FoldBySum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment