Skip to content

Commit

Permalink
Simplify away QueenContactCheck
Browse files Browse the repository at this point in the history
Simplify away QueenContactCheck
  • Loading branch information
snicolet committed Jan 30, 2017
1 parent bcf498a commit cbe862f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/evaluate.cpp
Expand Up @@ -209,7 +209,6 @@ namespace {
const int KingAttackWeights[PIECE_TYPE_NB] = { 0, 0, 78, 56, 45, 11 };

// Penalties for enemy's safe checks
const int QueenContactCheck = 997;
const int QueenCheck = 745;
const int RookCheck = 688;
const int BishopCheck = 588;
Expand Down Expand Up @@ -430,13 +429,6 @@ namespace {
- 717 * !pos.count<QUEEN>(Them)
- 7 * mg_value(score) / 5 - 5;

// Analyse the enemy's safe queen contact checks. Firstly, find the
// undefended squares around our king reachable by the enemy queen...
b = undefended & ei.attackedBy[Them][QUEEN] & ~pos.pieces(Them);

// ...and keep squares supported by another enemy piece.
kingDanger += QueenContactCheck * popcount(b & ei.attackedBy2[Them]);

// Analyse the safe enemy's checks which are possible on next move
safe = ~pos.pieces(Them);
safe &= (~ei.attackedBy[Us][ALL_PIECES] | (undefended & ei.attackedBy2[Them]));
Expand Down

6 comments on commit cbe862f

@locutus2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good luck for LTC!

@pb00068
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magic, Congratulations!

@joergoster
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats!

@alwey
Copy link

@alwey alwey commented on cbe862f Jan 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@lucasart
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! after all this makes sense, since we already removed KnightContactCheck, BishopContactCheck, and RookContactCheck.

@locutus2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats too!

Please sign in to comment.