From eac306447294863b3c5591c2f51b1e76bd257de1 Mon Sep 17 00:00:00 2001 From: niliara-edu Date: Wed, 4 Dec 2024 18:45:06 +0100 Subject: visuals --- src/index.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 src/index.js (limited to 'src/index.js') diff --git a/src/index.js b/src/index.js new file mode 100755 index 0000000..cde047f --- /dev/null +++ b/src/index.js @@ -0,0 +1,30 @@ +import { board, prepareBoard } from "./board.js" +import { Vector2 } from "./engine/visual.js" +import { Stone } from "./stones.js" + +let turn = "" + +function start() { + prepareBoard() + nextTurn() +} + +function nextTurn() { + turn = turn != "black" ? turn = "black" : turn = "white" + for (let row = 0; row < board.size; row++) { + for (let col = 0; col < board.size; col++) { + placeLink(new Vector2(row, col)) + } + } +} + +function placeLink(position) { + console.log("link to", position.x, position.y) + new Stone({ + position: position, + team: (position.x + position.y) % 2 ? "white" : "black" + }) +} + + +start() -- cgit v1.2.3