Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobcat committed Aug 31, 2013
1 parent 92de922 commit 46a9018
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
20 changes: 10 additions & 10 deletions src/Eval.h
Expand Up @@ -490,14 +490,14 @@ BB Eval::pawns_trap_bishop_a7h7[2][2] = {
};

int Eval::knight_pcsq_mg[64] = {
-95, -20, -10, -5, -5, -10, -20, -95,
-48, -20, -10, -5, -5, -10, -20, -48,
-16, -1, 10, 14, 14, 10, -1, -16,
-7, 8, 18, 23, 23, 18, 8, -7,
-5, 10, 20, 25, 25, 20, 10, -5,
-10, 5, 15, 20, 20, 15, 5, -10,
-20, -5, 5, 10, 10, 5, -5, -20,
-35, -20, -10, -5, -5, -10, -20, -35,
-55, -40, -30, -25, -25, -30, -40, -55
-8, 8, 18, 23, 23, 18, 8, -8,
-4, 10, 20, 25, 25, 20, 10, -4,
-8, 5, 15, 20, 20, 15, 5, -8,
-16, -5, 5, 10, 10, 5, -5, -16,
-48, -20, -10, -5, -5, -10, -20, -48,
-64, -40, -28, -22, -22, -28, -40, -64
};

int Eval::knight_pcsq_eg[64] = {
Expand All @@ -515,9 +515,9 @@ int Eval::bishop_pcsq_mg[64] = {
3, 0, -5, -9, -9, -5, 0, 3,
-2, 4, 0, 0, 0, 0, 4, -2,
-6, 0, 7, 8, 8, 7, 0, -6,
-9, 0, 6, 15, 15, 6, 0, -9,
-9, 0, 6, 15, 15, 6, 0, -9,
-6, 0, 7, 6, 6, 7, 0, -6,
-9, 0, 6, 12, 12, 6, 0, -9,
-9, 0, 6, 10, 10, 6, 0, -9,
-6, 0, 0, 0, 0, 0, 0, -6,
-2, 4, 0, 0, 0, 0, 4, -2,
-6, -5, -8, -11, -11, -8, -5, -6
};
Expand Down
15 changes: 10 additions & 5 deletions src/Search.h
Expand Up @@ -165,9 +165,11 @@ class Search : public Runnable, MoveSorter {
}
else if (best_move) {
updateHistoryScores(best_move, depth);
updateKillerMoves(best_move);

if (best_score < beta) {
if (best_score >= beta) {
updateKillerMoves(best_move);
}
else {
return searchNodeScore(best_score);
}
}
Expand Down Expand Up @@ -382,7 +384,10 @@ class Search : public Runnable, MoveSorter {
}
else if (best_move) {
updateHistoryScores(best_move, depth);
updateKillerMoves(best_move);

if (best_score >= beta) {
updateKillerMoves(best_move);
}
}
return storeSearchNodeScore(best_score, depth, nodeType(best_score, beta, best_move), best_move);
}
Expand All @@ -393,7 +398,7 @@ class Search : public Runnable, MoveSorter {
&& depth >= 4
&& pos->transp_move)
{
if (searchFailLow(depth/2, pos->eval_score - 75, pos->transp_move)) {
if (searchFailLow(depth/2, std::max(-MAXSCORE, pos->eval_score - 75), pos->transp_move)) {
return pos->transp_move;
}
}
Expand Down Expand Up @@ -494,7 +499,7 @@ class Search : public Runnable, MoveSorter {
{
return depth - 2;
}
Depth next_depth = depth - 2 - depth/6 - (move_count-6)/12;
Depth next_depth = depth - 2 - depth/8 - (move_count-6)/12;

if (next_depth <= 3
&& -pos->eval_score + futility_margin[std::max(0, next_depth)] < alpha)
Expand Down

0 comments on commit 46a9018

Please sign in to comment.