From eb460fbb161e76052b7bdd2c57afc65e2e99bc2e Mon Sep 17 00:00:00 2001 From: niliara-edu Date: Thu, 12 Dec 2024 13:51:59 +0100 Subject: place pieces --- src/index.js | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'src/index.js') diff --git a/src/index.js b/src/index.js index 8af22e7..70c9695 100755 --- a/src/index.js +++ b/src/index.js @@ -1,34 +1,11 @@ -import { board, prepareBoard } from "./board.js" -import { Vector2 } from "./engine/visual.js" -import { Stone } from "./stones.js" +import { prepareBoard } from "./board.js" +import { nextTurn } from "./engine/turns.js" -let turn = "" function start() { prepareBoard() nextTurn() } -function nextTurn() { - placeLinks() -} - -function placeLinks() { - turn = turn != "black" ? turn = "black" : turn = "white" - for (let row = 0; row < board.size; row++) { - for (let col = 0; col < board.size; col++) { - tryLink(new Vector2(row, col)) - } - } -} - -function tryLink(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