diff options
Diffstat (limited to 'src/engine/moves.js')
-rw-r--r-- | src/engine/moves.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/engine/moves.js b/src/engine/moves.js index f820f97..26158a0 100644 --- a/src/engine/moves.js +++ b/src/engine/moves.js @@ -1,11 +1,17 @@ import { board } from "../board.js" +import { hasLiberties } from "./liberty.js" export function isMoveLegal({ position, - turn = "none" + team = "none" }) { if (board.stones[position.y][position.x] != undefined) { return false } + + if (!hasLiberties({position: position, team: team})) { + return false + } + return true } |