new PiPo({
x: coords.x,
y: coords.y,
- c: C.GetOppCol(this.turn),
+ c: C.GetOppTurn(this.turn),
p: 'p'
})
);
// NOTE: size.x == size.y (square boards)
const emptyCount = C.FenEmptySquares(this.size.x);
return {
- fen: (emptyCount + "/").repeat(this.size.x).slice(0, -1) + " w 0",
+ fen: (emptyCount + "/").repeat(this.size.x - 1) + emptyCount,
o: {}
};
}
play(move) {
this.playOnBoard(move);
this.movesCount++;
- this.turn = C.GetOppCol(this.turn);
+ this.turn = C.GetOppTurn(this.turn);
}
getCurrentScore() {
- const oppCol = C.GetOppCol(this.turn);
+ const oppCol = C.GetOppTurn(this.turn);
// Search for connecting path of opp color:
let explored = {}, component;
let min, max;
max = z;
explored[index] = true;
component[index] = true;
- for (let [dx, dy] of super.pieces()['k'].moves[0].steps) {
+ for (let [dx, dy] of super.pieces()['k'].both[0].steps) {
const [nx, ny] = [x + dx, y + dy];
const nidx = getIndex(nx, ny);
if (