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/visual/createBoard.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/engine/visual/createBoard.js (limited to 'src/engine/visual/createBoard.js') diff --git a/src/engine/visual/createBoard.js b/src/engine/visual/createBoard.js new file mode 100644 index 0000000..06fcf5e --- /dev/null +++ b/src/engine/visual/createBoard.js @@ -0,0 +1,15 @@ +import { board } from "../../board.js" + +export 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