diff --git a/server/src/chess/engine.ts b/server/src/chess/engine.ts index 1ad9199..24fc5b6 100644 --- a/server/src/chess/engine.ts +++ b/server/src/chess/engine.ts @@ -416,6 +416,8 @@ export default class Chess { emptySquares = 0; } + if (emptySquares) position += `${emptySquares}`; + let castling = ""; if (this._castling.w & MOVE_FLAGS.K_CASTLE) castling += "K"; @@ -423,6 +425,8 @@ export default class Chess { if (this._castling.b & MOVE_FLAGS.K_CASTLE) castling += "k"; if (this._castling.b & MOVE_FLAGS.Q_CASTLE) castling += "q"; + if (castling == "") castling = "-"; + return [ position.substring(1), // remove first '/' this._turn,