We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 85c049e commit bfd9bf4Copy full SHA for bfd9bf4
src/chess.ts
@@ -1086,16 +1086,20 @@ export class Chess {
1086
return this._getPositionCount(this.fen()) >= 3
1087
}
1088
1089
- isDraw() {
+ isDrawByFiftyMoves(): boolean {
1090
+ return this._halfMoves >= 100 // 50 moves per side = 100 half moves
1091
+ }
1092
+
1093
+ isDraw(): boolean {
1094
return (
- this._halfMoves >= 100 || // 50 moves per side = 100 half moves
1095
+ this.isDrawByFiftyMoves() ||
1096
this.isStalemate() ||
1097
this.isInsufficientMaterial() ||
1098
this.isThreefoldRepetition()
1099
)
1100
1101
- isGameOver() {
1102
+ isGameOver(): boolean {
1103
return this.isCheckmate() || this.isStalemate() || this.isDraw()
1104
1105
0 commit comments