-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Allow immediate draws if opponent has no mating material #16989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow immediate draws if opponent has no mating material #16989
Conversation
…immediately end the game as a draw.
…s' into insufficient-material-draw-claims
|
Thanks! Just to be sure, did you try it in an actual game? |
|
@ornicar Yup, I tested it in a few games and seems to work. There's no reason given for the draw though after the game is done, it just displays "Draw". I don't know if it's worth adding new messages like "White/Black claimed a draw", or if just "Draw" is sufficient. |
* With variants, it's not correct to assume that all remaining cases are about insufficient material. Would have to be handled in insufficientMaterial() branch above. * Insufficient material does not have to be "claimed". The arbiter should end the game immediately, and lila does it automatically (if detected).
| _ <- proxy.save(progress) | ||
| _ = publishDrawOffer(progress.game) | ||
| yield List(Event.DrawOffer(by = color.some)) | ||
| if pov.game.situation.copy(color = color).opponentHasInsufficientMaterial then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot just swap the color and check for opponentHasInsufficientMaterial because it's not only depends on pieces on the board, but also whose turn to play. Look at this antichess position: https://lichess.org/analysis/antichess/8/8/3N4/8/1n6/8/8/8_w_-_-_15_44 (from #17536) whoever play can win the game so pov.game.situation.copy(color = color).opponentHasInsufficientMaterial is true for both sides, even though in real game only White can win.
If player A offers a draw when they have mating material but player B doesn't, call the game a draw immediately.