fix: getFEN

This commit is contained in:
Cozma Rares
2023-04-15 00:40:07 +03:00
parent 6988e65e44
commit d5bfe6f5b2
+4
View File
@@ -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,