blob: cde047fa805c5d4a9293360c71580d30a215a4b8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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()
|