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/board.js | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'src/board.js') diff --git a/src/board.js b/src/board.js index 82b6b28..3777080 100644 --- a/src/board.js +++ b/src/board.js @@ -1,3 +1,5 @@ +import { createBoard } from "./engine/visual/createBoard.js" + export let board = { element: document.getElementById("board"), size: 9, @@ -9,19 +11,3 @@ export function prepareBoard() { board.stones = [...Array(board.size)].map(_ => Array(board.size)) createBoard(board.size) } - -// ########### board engine ############# - -function createBoard(size) { - let table = document.createElement("table") - for (let r = 1; r < size; r++) { - let tr = document.createElement("tr") - - for (let c = 1; c < size; c++) { - let td = document.createElement("td") - tr.appendChild(td) - } - table.appendChild(tr) - } - board.element.appendChild(table) -} -- cgit v1.2.3