Skip to content

Commit

Permalink
Include bishops
Browse files Browse the repository at this point in the history
  • Loading branch information
eduherminio committed Nov 22, 2024
1 parent 735f4ba commit 3269090
Show file tree
Hide file tree
Showing 3 changed files with 2,936 additions and 2,935 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ static partial class EvaluationParams
public const int KingShieldBonus = -196585;

/// <summary>
/// <see cref="Utils.Pack(30, 72)"/>
/// <see cref="Utils.Pack(30, 71)"/>
/// </summary>
public const int BishopPairBonus = 4718622;
public const int BishopPairBonus = 4653086;

/// <summary>
/// <see cref="Utils.Pack(12, 15)"/>
Expand All @@ -48,8 +48,8 @@ static partial class EvaluationParams
public const int PieceAttackedByPawnPenalty = -2162735;

/// <summary>
/// <see cref="Utils.Pack(55, 94)"/>
/// <see cref="Utils.Pack(43, 58)"/>
/// </summary>
public const int KnightForkBounus = 6160439;
public const int KnightForkBounus = 3801131;

}
3 changes: 2 additions & 1 deletion src/Lynx/Model/Position.cs
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,8 @@ private int KnightAdditionalEvaluation(int squareIndex, int pieceSide, int oppos
var offset = Utils.PieceOffset(pieceSide);
var majorPieces = PieceBitBoards[(int)Piece.k - offset] |
PieceBitBoards[(int)Piece.q - offset] |
PieceBitBoards[(int)Piece.r - offset];
PieceBitBoards[(int)Piece.r - offset] |
PieceBitBoards[(int)Piece.b - offset];

var enemyPiecesAttackedCount = (attacks & majorPieces).CountBits();

Expand Down
Loading

0 comments on commit 3269090

Please sign in to comment.