Skip to content

Commit

Permalink
Fix PassedPawnBonus
Browse files Browse the repository at this point in the history
  • Loading branch information
eduherminio committed Sep 21, 2023
1 parent ca2d671 commit 9a220f3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/Lynx/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,17 @@ public sealed class EngineSettings

public int DoubledPawnPenalty { get; set; } = 10;

public int[] PassedPawnBonus { get; set; } = new[] { 0, 10, 30, 50, 75, 100, 150, 200 };
public int[] PassedPawnBonus { get; set; } = new[]
{
0,
4,
-2,
19,
44,
82,
136,
200
};

public int SemiOpenFileRookBonus { get; set; } = 10;

Expand Down
22 changes: 21 additions & 1 deletion tests/Lynx.Test/EvaluationConstantsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using static Lynx.EvaluationConstants;

namespace Lynx.Test;
public class EvaluationConstantsTest
public class EvaluationConstantsTestº
{
/// <summary>
/// Shy from 14k
Expand Down Expand Up @@ -133,4 +133,24 @@ public void SingleMoveEvaluation()
Assert.Greater(EvaluationConstants.SingleMoveEvaluation, 100);
Assert.Less(EvaluationConstants.SingleMoveEvaluation, 400);
}

[Test]
public void PSQTSize()
{
Assert.AreEqual(12, MiddleGamePositionalTables.Length);
foreach (var table in MiddleGamePositionalTables)
{
Assert.AreEqual(64, table.Length);
}

Assert.AreEqual(12, EndGamePositionalTables.Length);
foreach (var table in EndGamePositionalTables)
{
Assert.AreEqual(64, table.Length);
}

Assert.AreEqual(5, GamePhaseByPiece.Length);
Assert.AreEqual(12, MiddleGamePieceValues.Length);
Assert.AreEqual(12, EndGamePieceValues.Length);
}
}

0 comments on commit 9a220f3

Please sign in to comment.