+ pgn += "\n\n";
+ for (let i = 0; i < this.moves.length; i += 2) {
+ const moveNumber = this.moves[i].index / 2 + 1;
+ // Skip "dots move", useless for machine reading:
+ if (this.moves[i].notation != "...") {
+ pgn += moveNumber + ".w " +
+ getFullNotation(this.moves[i], "unambiguous") + "\n";
+ }
+ if (i+1 < this.moves.length) {
+ pgn += moveNumber + ".b " +
+ getFullNotation(this.moves[i+1], "unambiguous") + "\n";
+ }
+ }
+ return pgn;