Created
February 10, 2012 16:12
-
-
Save dungpa/1790542 to your computer and use it in GitHub Desktop.
Util functions of Board class
This file contains hidden or 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
member x.safe(row) = | |
not (rows.[row] || fwDiagonals.[row + col] | |
|| bwDiagonals.[row - col + size - 1]) | |
member x.placeQueen(row) = | |
rows.[row] <- true | |
fwDiagonals.[row + col] <- true | |
bwDiagonals.[row - col + size - 1] <- true | |
col <- col+1 | |
member x.removeQueen(row) = | |
col <- col-1 | |
rows.[row] <- false | |
fwDiagonals.[row + col] <- false | |
bwDiagonals.[row - col + size - 1] <- false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment