for (let j=0; j<sizeY; j++)
{
if (this.board[i][j] != VariantRules.EMPTY
+ && colors.includes(this.getColor(i,j))
&& this.getPiece(i,j) == VariantRules.ROOK)
{
if (this.isImmobilized([i,j]))
{
return "0000"; //TODO: or "-" ?
}
+
+ getNotation(move)
+ {
+ const initialSquare =
+ String.fromCharCode(97 + move.start.y) + (VariantRules.size[0]-move.start.x);
+ const finalSquare =
+ String.fromCharCode(97 + move.end.y) + (VariantRules.size[0]-move.end.x);
+ let notation = undefined;
+ if (move.appear[0].p == VariantRules.PAWN)
+ {
+ // Pawn: generally ambiguous short notation, so we use full description
+ notation = "P" + initialSquare + finalSquare;
+ }
+ else if (move.appear[0].p == VariantRules.KING)
+ notation = "K" + (move.vanish.length>1 ? "x" : "") + finalSquare;
+ else
+ notation = move.appear[0].p.toUpperCase() + finalSquare;
+ if (move.vanish.length > 1 && move.appear[0].p != VariantRules.KING)
+ notation += "X"; //capture mark (not describing what is captured...)
+ return notation;
+ }
}