mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-15 10:22:40 +01:00
DroidFish: Updated stockfish to version 2.3.
This commit is contained in:
@@ -435,8 +435,8 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||
&& sf == SCALE_FACTOR_NORMAL)
|
||||
{
|
||||
// Only the two bishops ?
|
||||
if ( pos.non_pawn_material(WHITE) == BishopValueMidgame
|
||||
&& pos.non_pawn_material(BLACK) == BishopValueMidgame)
|
||||
if ( pos.non_pawn_material(WHITE) == BishopValueMg
|
||||
&& pos.non_pawn_material(BLACK) == BishopValueMg)
|
||||
{
|
||||
// Check for KBP vs KB with only a single pawn that is almost
|
||||
// certainly a draw or at least two pawns.
|
||||
@@ -492,7 +492,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||
|
||||
// Init king safety tables only if we are going to use them
|
||||
if ( pos.piece_count(Us, QUEEN)
|
||||
&& pos.non_pawn_material(Us) >= QueenValueMidgame + RookValueMidgame)
|
||||
&& pos.non_pawn_material(Us) >= QueenValueMg + RookValueMg)
|
||||
{
|
||||
ei.kingRing[Them] = (b | (Us == WHITE ? b >> 8 : b << 8));
|
||||
b &= ei.attackedBy[Us][PAWN];
|
||||
@@ -582,7 +582,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||
assert(b);
|
||||
|
||||
if (!more_than_one(b) && (b & pos.pieces(Them)))
|
||||
score += ThreatBonus[Piece][type_of(pos.piece_on(first_1(b)))];
|
||||
score += ThreatBonus[Piece][type_of(pos.piece_on(lsb(b)))];
|
||||
}
|
||||
|
||||
// Decrease score if we are attacked by an enemy pawn. Remaining part
|
||||
@@ -870,7 +870,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||
return SCORE_ZERO;
|
||||
|
||||
do {
|
||||
Square s = pop_1st_bit(&b);
|
||||
Square s = pop_lsb(&b);
|
||||
|
||||
assert(pos.pawn_is_passed(Us, s));
|
||||
|
||||
@@ -938,7 +938,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||
// value if the other side has a rook or queen.
|
||||
if (file_of(s) == FILE_A || file_of(s) == FILE_H)
|
||||
{
|
||||
if (pos.non_pawn_material(Them) <= KnightValueMidgame)
|
||||
if (pos.non_pawn_material(Them) <= KnightValueMg)
|
||||
ebonus += ebonus / 4;
|
||||
else if (pos.pieces(Them, ROOK, QUEEN))
|
||||
ebonus -= ebonus / 4;
|
||||
@@ -976,8 +976,8 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||
|
||||
while (b)
|
||||
{
|
||||
s = pop_1st_bit(&b);
|
||||
queeningSquare = relative_square(c, make_square(file_of(s), RANK_8));
|
||||
s = pop_lsb(&b);
|
||||
queeningSquare = relative_square(c, file_of(s) | RANK_8);
|
||||
queeningPath = forward_bb(c, s);
|
||||
|
||||
// Compute plies to queening and check direct advancement
|
||||
@@ -1017,10 +1017,10 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||
|
||||
while (b)
|
||||
{
|
||||
s = pop_1st_bit(&b);
|
||||
s = pop_lsb(&b);
|
||||
|
||||
// Compute plies from queening
|
||||
queeningSquare = relative_square(loserSide, make_square(file_of(s), RANK_8));
|
||||
queeningSquare = relative_square(loserSide, file_of(s) | RANK_8);
|
||||
movesToGo = rank_distance(s, queeningSquare) - int(relative_rank(loserSide, s) == RANK_2);
|
||||
pliesToGo = 2 * movesToGo - int(loserSide == pos.side_to_move());
|
||||
|
||||
@@ -1039,12 +1039,12 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||
|
||||
while (b)
|
||||
{
|
||||
s = pop_1st_bit(&b);
|
||||
s = pop_lsb(&b);
|
||||
sacptg = blockersCount = 0;
|
||||
minKingDist = kingptg = 256;
|
||||
|
||||
// Compute plies from queening
|
||||
queeningSquare = relative_square(loserSide, make_square(file_of(s), RANK_8));
|
||||
queeningSquare = relative_square(loserSide, file_of(s) | RANK_8);
|
||||
movesToGo = rank_distance(s, queeningSquare) - int(relative_rank(loserSide, s) == RANK_2);
|
||||
pliesToGo = 2 * movesToGo - int(loserSide == pos.side_to_move());
|
||||
|
||||
@@ -1058,7 +1058,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||
// How many plies does it take to remove all the blocking pawns?
|
||||
while (blockers)
|
||||
{
|
||||
blockSq = pop_1st_bit(&blockers);
|
||||
blockSq = pop_lsb(&blockers);
|
||||
movesToGo = 256;
|
||||
|
||||
// Check pawns that can give support to overcome obstacle, for instance
|
||||
@@ -1069,7 +1069,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||
|
||||
while (b2) // This while-loop could be replaced with LSB/MSB (depending on color)
|
||||
{
|
||||
d = square_distance(blockSq, pop_1st_bit(&b2)) - 2;
|
||||
d = square_distance(blockSq, pop_lsb(&b2)) - 2;
|
||||
movesToGo = std::min(movesToGo, d);
|
||||
}
|
||||
}
|
||||
@@ -1079,7 +1079,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||
|
||||
while (b2) // This while-loop could be replaced with LSB/MSB (depending on color)
|
||||
{
|
||||
d = square_distance(blockSq, pop_1st_bit(&b2)) - 2;
|
||||
d = square_distance(blockSq, pop_lsb(&b2)) - 2;
|
||||
movesToGo = std::min(movesToGo, d);
|
||||
}
|
||||
|
||||
@@ -1172,7 +1172,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||
// A couple of little helpers used by tracing code, to_cp() converts a value to
|
||||
// a double in centipawns scale, trace_add() stores white and black scores.
|
||||
|
||||
double to_cp(Value v) { return double(v) / double(PawnValueMidgame); }
|
||||
double to_cp(Value v) { return double(v) / double(PawnValueMg); }
|
||||
|
||||
void trace_add(int idx, Score wScore, Score bScore) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user