play(move, ingame)
{
+ // DEBUG:
+// if (!this.states) this.states = [];
+// if (!ingame) this.states.push(JSON.stringify(this.board));
+
if (!!ingame)
move.notation = [this.getNotation(move), this.getLongNotation(move)];
this.moves.pop();
this.unupdateVariables(move);
this.parseFlags(JSON.parse(move.flags));
+
+ // DEBUG:
+// if (JSON.stringify(this.board) != this.states[this.states.length-1])
+// debugger;
+// this.states.pop();
}
//////////////
pieces[c][knight2Pos] = 'n';
pieces[c][rook2Pos] = 'r';
}
- let fen = pieces["b"].join("") +
+ return pieces["b"].join("") +
"/pppppppp/8/8/8/8/PPPPPPPP/" +
pieces["w"].join("").toUpperCase() +
" 1111"; //add flags
- return fen;
}
// Return current fen according to pieces+colors state