mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Triviality in struct PieceLetters
And little touches in search() too. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
d55a5a4d81
commit
f97c5b6909
2 changed files with 21 additions and 17 deletions
|
@ -101,20 +101,23 @@ namespace {
|
||||||
operator[]('B') = WB; operator[]('b') = BB;
|
operator[]('B') = WB; operator[]('b') = BB;
|
||||||
operator[]('N') = WN; operator[]('n') = BN;
|
operator[]('N') = WN; operator[]('n') = BN;
|
||||||
operator[]('P') = WP; operator[]('p') = BP;
|
operator[]('P') = WP; operator[]('p') = BP;
|
||||||
operator[](' ') = PIECE_NONE; operator[]('.') = PIECE_NONE_DARK_SQ;
|
operator[](' ') = PIECE_NONE;
|
||||||
|
operator[]('.') = PIECE_NONE_DARK_SQ;
|
||||||
}
|
}
|
||||||
|
|
||||||
char from_piece(Piece p) const {
|
char from_piece(Piece p) const {
|
||||||
|
|
||||||
std::map<char, Piece>::const_iterator it;
|
std::map<char, Piece>::const_iterator it;
|
||||||
for (it = begin(); it != end(); ++it)
|
for (it = begin(); it != end(); ++it)
|
||||||
if (it->second == p)
|
if (it->second == p)
|
||||||
return it->first;
|
return it->first;
|
||||||
|
|
||||||
assert(false);
|
assert(false);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} pieceLetters;
|
};
|
||||||
|
|
||||||
|
PieceLetters pieceLetters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -993,7 +993,8 @@ namespace {
|
||||||
threatMove = sp->threatMove;
|
threatMove = sp->threatMove;
|
||||||
mateThreat = sp->mateThreat;
|
mateThreat = sp->mateThreat;
|
||||||
goto split_point_start;
|
goto split_point_start;
|
||||||
} else {} // Hack to fix icc's "statement is unreachable" warning
|
}
|
||||||
|
else {} // Hack to fix icc's "statement is unreachable" warning
|
||||||
|
|
||||||
// Step 1. Initialize node and poll. Polling can abort search
|
// Step 1. Initialize node and poll. Polling can abort search
|
||||||
ss->currentMove = ss->bestMove = threatMove = MOVE_NONE;
|
ss->currentMove = ss->bestMove = threatMove = MOVE_NONE;
|
||||||
|
@ -1145,6 +1146,7 @@ namespace {
|
||||||
threatMove = (ss+1)->bestMove;
|
threatMove = (ss+1)->bestMove;
|
||||||
if ( depth < ThreatDepth
|
if ( depth < ThreatDepth
|
||||||
&& (ss-1)->reduction
|
&& (ss-1)->reduction
|
||||||
|
&& threatMove != MOVE_NONE
|
||||||
&& connected_moves(pos, (ss-1)->currentMove, threatMove))
|
&& connected_moves(pos, (ss-1)->currentMove, threatMove))
|
||||||
return beta - 1;
|
return beta - 1;
|
||||||
}
|
}
|
||||||
|
@ -1284,7 +1286,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prune neg. see moves at low depths
|
// Prune moves with negative SEE at low depths
|
||||||
if ( predictedDepth < 2 * ONE_PLY
|
if ( predictedDepth < 2 * ONE_PLY
|
||||||
&& bestValue > value_mated_in(PLY_MAX)
|
&& bestValue > value_mated_in(PLY_MAX)
|
||||||
&& pos.see_sign(move) < 0)
|
&& pos.see_sign(move) < 0)
|
||||||
|
@ -1301,7 +1303,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
|
|
||||||
// Step extra. pv search (only in PV nodes)
|
// Step extra. pv search (only in PV nodes)
|
||||||
// The first move in list is the expected PV
|
// The first move in list is the expected PV
|
||||||
if (!SpNode && PvNode && moveCount == 1)
|
if (PvNode && moveCount == 1)
|
||||||
value = -search<PV>(pos, ss+1, -beta, -alpha, newDepth, ply+1);
|
value = -search<PV>(pos, ss+1, -beta, -alpha, newDepth, ply+1);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1313,9 +1315,11 @@ split_point_start: // At split points actual search starts from here
|
||||||
&& !captureOrPromotion
|
&& !captureOrPromotion
|
||||||
&& !dangerous
|
&& !dangerous
|
||||||
&& !move_is_castle(move)
|
&& !move_is_castle(move)
|
||||||
&& !(ss->killers[0] == move || ss->killers[1] == move))
|
&& ss->killers[0] != move
|
||||||
|
&& ss->killers[1] != move)
|
||||||
{
|
{
|
||||||
ss->reduction = reduction<PvNode>(depth, moveCount);
|
ss->reduction = reduction<PvNode>(depth, moveCount);
|
||||||
|
|
||||||
if (ss->reduction)
|
if (ss->reduction)
|
||||||
{
|
{
|
||||||
alpha = SpNode ? sp->alpha : alpha;
|
alpha = SpNode ? sp->alpha : alpha;
|
||||||
|
@ -1702,11 +1706,8 @@ split_point_start: // At split points actual search starts from here
|
||||||
Square f1, t1, f2, t2;
|
Square f1, t1, f2, t2;
|
||||||
Piece p;
|
Piece p;
|
||||||
|
|
||||||
assert(move_is_ok(m1));
|
assert(m1 && move_is_ok(m1));
|
||||||
assert(move_is_ok(m2));
|
assert(m2 && move_is_ok(m2));
|
||||||
|
|
||||||
if (m2 == MOVE_NONE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Case 1: The moving piece is the same in both moves
|
// Case 1: The moving piece is the same in both moves
|
||||||
f2 = move_from(m2);
|
f2 = move_from(m2);
|
||||||
|
|
Loading…
Add table
Reference in a new issue