- pgn += getFullNotation(this.moves[i], "unambiguous") + "\n";
- if (i+1 < this.moves.length)
- pgn += getFullNotation(this.moves[i+1], "unambiguous") + "\n";
+ 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";
+ }