return TRUE;
}
+// board_has_queen()
+
+bool board_has_queen(const board_t * board, int colour) {
+
+ int sq_64, sq, piece;
+
+ ASSERT(board!=NULL);
+
+ for (sq_64 = 0; sq_64 < 64; sq_64++) {
+ sq = square_from_64(sq_64);
+ piece = board->square[sq];
+ if (colour_equal(piece,colour) && piece_is_queen(piece)) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
// board_init_list()
void board_init_list(board_t * board) {
extern void board_copy (board_t * dst, const board_t * src);
extern bool board_equal (const board_t * board_1, const board_t * board_2);
+extern bool board_has_queen (const board_t * board, int colour);
+
extern void board_init_list (board_t * board);
extern int board_flags (const board_t * board);
{ "Resign", "check","0","0", "false" , NULL,0,NNB, PG|XBOARD|XBSEL},
{ "ResignMoves", "spin","0","10000", "3" , NULL,0,NNB, PG|XBOARD|XBSEL},
+ { "QueenNeverResigns","check","0","0", "true" , NULL,0,NNB, PG|XBOARD|XBSEL},
{ "ResignScore", "spin","0","10000", "600" , NULL,0,NNB, PG|XBOARD|XBSEL},
{ "MateScore", "spin","0","100000", "10000" , NULL,0,NNB, PG|XBOARD},
my_log("POLYGLOT %d move%s with resign score\n",State->resign_nb,(State->resign_nb>1)?"s":"");
if (State->resign_nb >= option_get_int(Option,"ResignMoves")) {
- my_log("POLYGLOT *** RESIGN ***\n");
- gui_send(GUI,"resign");
+ if (!option_get_bool(Option,"QueenNeverResigns") || !board_has_queen(board, board->turn)) { // [HGM] suppress resignig with Queen
+ my_log("POLYGLOT *** RESIGN ***\n");
+ gui_send(GUI,"resign");
+ }
}
} else {