mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
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:
@@ -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(),
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user