Which other GUI does automatically forfeit an engine due to illegal draw claim?hgm wrote:I am sure I would have no problems programming it. But I don't think a desicion about which claims to accept and which to reject should be taken unilaterally. Otherwise we get into a situation where some claims are rejected by WinBoard but OK on, say Arena or ChessGUI, while others are accepted by WinBoard but lead to a forfeit with, say, Arena.
If there are other GUIs implementing this policy then I would expect from them, too, that they do not miss to implement trivial draw checks with absolutely no relevant cost and no significant risk.
Once again: it is trivial, every GUI can do it. Perhaps like this "C++ pseudocode" (not compiled):
Code: Select all
bool isKNK()
{
return (totalPieceCount(White) == 2 && totalPieceCount(Black) == 1 && pieceCount(White, Knight) == 1)
|| (totalPieceCount(White) == 1 && totalPieceCount(Black) == 2 && pieceCount(Black, Knight) == 1);
}
bool isKBxKBx_withLikeBishops()
{
if (totalPieceCount(White) + totalPieceCount(Black) != 2 + pieceCount(White, Bishop) + pieceCount(Black, Bishop)) {
return false;
}
// no other pieces than kings and bishops are present (this includes the cases KK, KBK, KBKB, KBBKB, ...)
int cBishops = COLOR_UNDEFINED;
bool ok = true;
static int const color[2] = { White, Black }; // in case you have different values than White=0/Black=1
for (int c = 0; c < 2 && ok; c++) {
for (int i = 0; i < pieceCount(color[c], Bishop) && ok; i++) {
// get next bishop, e.g. from piece list, and get its square color
int cThisBishop = colorOfSquare(getBishopSquare(color[c], i));
if (cBishops == COLOR_UNDEFINED) {
cBishops = cThisBishop;
} else
if (cThisBishop != cBishops) { // found a bishop on different color
ok = false;
}
}
}
return ok;
}
bool isDrawByInsufficientMaterial()
{
return isKNK() || isKBxKBx_withLikeBishops();
}