1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import { board } from "../board.js" import { hasLiberties } from "./liberty.js" export function isMoveLegal({ position, team = "none" }) { if (board.stones[position.y][position.x] != undefined) { return false } if (!hasLiberties({position: position, team: team})) { return false } return true }