From 16e02376e2273eeb25a6461f84641e96a485f652 Mon Sep 17 00:00:00 2001 From: nil Date: Thu, 12 Dec 2024 18:20:22 +0100 Subject: add legal movements and organize --- src/engine/moves.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/engine/moves.js (limited to 'src/engine/moves.js') diff --git a/src/engine/moves.js b/src/engine/moves.js new file mode 100644 index 0000000..f820f97 --- /dev/null +++ b/src/engine/moves.js @@ -0,0 +1,11 @@ +import { board } from "../board.js" + +export function isMoveLegal({ + position, + turn = "none" +}) { + if (board.stones[position.y][position.x] != undefined) { + return false + } + return true +} -- cgit v1.2.3