Skip to content

Conversation

@johndoknjas
Copy link
Contributor

If player A offers a draw when they have mating material but player B doesn't, call the game a draw immediately.

@ornicar
Copy link
Collaborator

ornicar commented Feb 17, 2025

Thanks! Just to be sure, did you try it in an actual game?

@johndoknjas
Copy link
Contributor Author

@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.

@ornicar ornicar merged commit f547e72 into lichess-org:master Feb 19, 2025
4 checks passed
niklasf referenced this pull request Apr 14, 2025
 * 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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants