summaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
authorniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2024-12-12 13:51:59 +0100
committerniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2024-12-12 13:51:59 +0100
commiteb460fbb161e76052b7bdd2c57afc65e2e99bc2e (patch)
tree2d8bd718d099a3c9202ac63fb9146754b07e4ef4 /src/index.js
parentfa377bcc6d4793dcd79ae5c07a43a1193aa2613a (diff)
place pieces
Diffstat (limited to 'src/index.js')
-rwxr-xr-xsrc/index.js27
1 files changed, 2 insertions, 25 deletions
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()