genRandInitBaseFen() {
const s = FenUtil.setupPieces(
- ['r', 'n', 'b', 'q', 'k', 'b', 'n', 'r'], {diffCol: ['b']});
+ ['r', 'n', 'b', 'q', 'k', 'b', 'n', 'r'],
+ {
+ randomness: this.options["randomness"],
+ diffCol: ['b']
+ }
+ );
return {
fen: s.b.join("") + "/pppppppp/8/8/8/8/PPPPPPPP/" +
s.w.join("").toUpperCase(),
// Subturn 2: play a move for me (which just indicate a square).
getPotentialMovesFrom([x, y]) {
const color = this.turn;
- const oppCol = C.GetOppCol(color);
+ const oppCol = C.GetOppTurn(color);
if (this.subTurn == 2) {
// Just play a normal move (which in fact only indicate a square)
let movesHash = {};
getCurrentScore() {
// This function is only called at subTurn 1
- const color = C.GetOppCol(this.turn);
+ const color = C.GetOppTurn(this.turn);
if (this.searchKingPos(color).length == 0)
return (color == 'w' ? "0-1" : "1-0");
return "*";
postPlay(move) {
const color = this.turn;
if (this.subTurn == 2 || this.searchKingPos(color).length == 0) {
- this.turn = C.GetOppCol(color);
+ this.turn = C.GetOppTurn(color);
this.movesCount++;
}
this.subTurn = 3 - this.subTurn;