+
+ // The score is already computed when calling this function
+ getPGN(mycolor, score)
+ {
+ let pgn = "";
+ pgn += '[Site "vchess.club"]<br>';
+ const d = new Date();
+ pgn += '[Date "' + d.getFullYear() + '-' + d.getMonth() + '-' + d.getDate() + '"]<br>';
+ pgn += '[White "' + (mycolor=='w'?'Myself':'Anonymous') + '"]<br>';
+ pgn += '[Black "' + (mycolor=='b'?'Myself':'Anonymous') + '"]<br>';
+ pgn += '[Result "' + score + '"]<br>';
+
+ for (let i=0; i<this.moves.length; i++)
+ {
+ if (i % 2 == 0)
+ pgn += ((i/2)+1) + ".";
+ pgn += this.moves[i].notation + " ";
+ }
+
+ pgn += score;
+ return pgn;
+ }