Play draw endgames and solve on a rule draw

#10: drawn positions are graded against the draw as the target — a move
that keeps it passes, a losing move fails, and a rule draw reported by
chess.js (insufficient material, repetition, or 50-move) solves the
puzzle. The promotion cutoff now applies only to win puzzles.
This commit is contained in:
2026-11-01 22:04:21 +01:00
parent c5989628bc
commit be23f1d7f8
3 changed files with 167 additions and 29 deletions
+4
View File
@@ -161,6 +161,8 @@ export const ChessBoard = {
fen: this.chess.fen(),
san: move.san,
promotion: promotion || null,
draw: this.chess.isDraw(),
checkmate: this.chess.isCheckmate(),
};
if (isTrainer) {
@@ -204,6 +206,8 @@ export const ChessBoard = {
this.pushEvent("opponent_reply_applied", {
fen: this.chess.fen(),
san: move.san,
draw: this.chess.isDraw(),
checkmate: this.chess.isCheckmate(),
});
},