Commit a207488
committed
Allow fifty-move claim ahead of a checkmating or stalemating move
can_claim_fifty_moves() pushed each non-zeroing legal move and tested the
result with is_fifty_moves(), which is False when the resulting position has
no legal moves. A move that completes the 100 halfmoves but also gives
checkmate or stalemate was therefore rejected.
Under FIDE 9.3 the claim is made ahead of the move: the player only declares
a non-pawn, non-capture move that completes the count; it is not played, so
its being game-ending does not invalidate the claim. With the clock at 99 any
non-zeroing legal move completes the count, so the push/is_fifty_moves() test
becomes a direct check. Positions that are already checkmate or stalemate
still return False (no legal moves to iterate).
Closes #1188.1 parent 8330cfd commit a207488
2 files changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2297 | 2297 | | |
2298 | 2298 | | |
2299 | 2299 | | |
| 2300 | + | |
| 2301 | + | |
2300 | 2302 | | |
2301 | 2303 | | |
2302 | | - | |
2303 | | - | |
2304 | | - | |
2305 | | - | |
2306 | | - | |
2307 | | - | |
| 2304 | + | |
2308 | 2305 | | |
2309 | 2306 | | |
2310 | 2307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1376 | 1376 | | |
1377 | 1377 | | |
1378 | 1378 | | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
1379 | 1388 | | |
1380 | 1389 | | |
1381 | 1390 | | |
| |||
0 commit comments