summaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.js')
-rwxr-xr-xsrc/index.js30
1 files changed, 30 insertions, 0 deletions
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()