src/arasanx.cpp
// return true if current board position is a draw by the
// rules of chess.
return true if current board position is a draw by the
rules of chess.
return true if current board position is a draw by the rules of chess .
static int isDraw(const Board &board, Statistics &last_stats, string &reason) {
   if (last_stats.state == Stalemate) {
       if (doTrace) cout << "# stalemate" << endl;
       reason = "Stalemate";
       return 1;
   }
   else if (last_stats.value < Constants::MATE-1 &&
            board.state.moveCount >= 100) {
       if (doTrace) cout << "# 50 move draw" << endl;
       reason = "50 move draw";
       return 1;
   }
   else if (Scoring::materialDraw(board)) {
       if (doTrace) cout << "# material draw" << endl;
       reason = "Insufficient material";
       return 1;
   }
   else if (Scoring::repetitionDraw(board)) {
       if (doTrace) cout << "# repetition draw" << endl;
       reason = "Repetition";
       return 1;
   }
   else if (stats.state == Draw) {
       return 1;
   }
   return 0;
}
static int isDraw ( const Board & board , Statistics & last_stats , string & reason ) { if ( last_stats . state == Stalemate ) { if ( doTrace ) cout << " " << endl ; reason = " " ; return 1 ; } else if ( last_stats . value < Constants :: MATE - 1 && board . state . moveCount > = 100 ) { if ( doTrace ) cout << " " << endl ; reason = " " ; return 1 ; } else if ( Scoring :: materialDraw ( board ) ) { if ( doTrace ) cout << " " << endl ; reason = " " ; return 1 ; } else if ( Scoring :: repetitionDraw ( board ) ) { if ( doTrace ) cout << " " << endl ; reason = " " ; return 1 ; } else if ( stats . state == Draw ) { return 1 ; } return 0 ; }
return true if current board position is a draw by the
rules of chess.
return true if current board position is a draw by the rules of chess .
// Note: do not count as draw if we have checkmated opponent!