src/scoring.cpp
// adjust material score when both sides have pawn(s)
adjust material score when both sides have pawn(s)
adjust material score when both sides have pawn ( s )
static int near_draw_adjust(const Material &ourmat,
                            const Material &oppmat,
                            int pawndiff) 
{
   int score = 0;
   if (pawndiff == 0) {
      score += -int(0.6*PAWN_VALUE)+Util::Min(4,ourmat.pawnCount())*int(0.1*PAWN_VALUE);
   }
   else if (pawndiff == 1) {
      score += -int(0.4*PAWN_VALUE)+Util::Min(4,ourmat.pawnCount())*int(0.05*PAWN_VALUE);
   }
   else if (pawndiff == -1 || pawndiff == -2) {
      score += int(0.4*PAWN_VALUE)-(4-Util::Min(4,oppmat.pawnCount()))*int(0.1*PAWN_VALUE);
   }
   return score;
}
static int near_draw_adjust ( const Material & ourmat , const Material & oppmat , int pawndiff ) { int score = 0 ; if ( pawndiff == 0 ) { score += - int ( 0.6 * PAWN_VALUE ) + Util :: Min ( 4 , ourmat . pawnCount ( ) ) * int ( 0.1 * PAWN_VALUE ) ; } else if ( pawndiff == 1 ) { score += - int ( 0.4 * PAWN_VALUE ) + Util :: Min ( 4 , ourmat . pawnCount ( ) ) * int ( 0.05 * PAWN_VALUE ) ; } else if ( pawndiff == -1 || pawndiff == -2 ) { score += int ( 0.4 * PAWN_VALUE ) - ( 4 - Util :: Min ( 4 , oppmat . pawnCount ( ) ) ) * int ( 0.1 * PAWN_VALUE ) ; } return score ; }
adjust material score when both sides have pawn(s)
adjust material score when both sides have pawn ( s )
// stronger side's piece advantage is worth less, esp. with few pawns // add bonus for our side (thus, penalizing the other side for // having only 1-2 pawns advantage). Less bonus if more // oppponent pawns.