Skip to content

Instantly share code, notes, and snippets.

@fotonmoton
Created November 18, 2019 17:15
Show Gist options
  • Save fotonmoton/5646fb0e42d34448f3e040239a823fe7 to your computer and use it in GitHub Desktop.
Save fotonmoton/5646fb0e42d34448f3e040239a823fe7 to your computer and use it in GitHub Desktop.
module QueenAttack
let create (row, col) =
row >= 0 && row < 8 && col >= 0 && col < 8
let canAttack (row1, col1) (row2, col2) =
row1 = row2 || col1 = col2 || (abs (row1 - row2) = abs (col1 - col2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment