getCheckSquares(move)
{
this.play(move);
- const color = this.turn;
+ const color = this.turn; //opponent
let res = this.isAttacked(this.kingPos[color], this.getOppCol(color))
? [ JSON.parse(JSON.stringify(this.kingPos[color])) ] //need to duplicate!
: [ ];
let pgn = "";
pgn += '[Site "vchess.club"]<br>';
const d = new Date();
- const opponent = this.mode=="human" ? "Anonymous" : "Computer";
+ const opponent = mode=="human" ? "Anonymous" : "Computer";
pgn += '[Date "' + d.getFullYear() + '-' + (d.getMonth()+1) + '-' + d.getDate() + '"]<br>';
pgn += '[White "' + (mycolor=='w'?'Myself':opponent) + '"]<br>';
pgn += '[Black "' + (mycolor=='b'?'Myself':opponent) + '"]<br>';