Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Commit

Permalink
Tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
mhib committed Oct 31, 2020
1 parent 75e7077 commit e467581
Showing 1 changed file with 161 additions and 161 deletions.
322 changes: 161 additions & 161 deletions evaluation/evaluation.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,112 +16,112 @@ const RookPhase = 2
const QueenPhase = 4
const TotalPhase = PawnPhase*16 + KnightPhase*4 + BishopPhase*4 + RookPhase*4 + QueenPhase*2

var PawnValue = S(100, 120)
var KnightValue = S(508, 435)
var BishopValue = S(461, 432)
var RookValue = S(656, 691)
var QueenValue = S(1435, 1322)
var PawnValue = S(94, 140)
var KnightValue = S(502, 478)
var BishopValue = S(461, 466)
var RookValue = S(674, 785)
var QueenValue = S(1485, 1493)

// Piece Square Values
var PieceScores = [King + 1][8][4]Score{
{},
{ // knight
{S(-59, -40), S(-10, -54), S(-40, -35), S(-13, -24)},
{S(-18, -56), S(-25, -37), S(-10, -31), S(-3, -21)},
{S(-9, -39), S(0, -31), S(0, -22), S(3, -3)},
{S(-16, -28), S(14, -25), S(11, -1), S(4, 4)},
{S(-2, -32), S(3, -21), S(14, 2), S(19, 3)},
{S(-37, -51), S(22, -43), S(-52, -7), S(28, -6)},
{S(-76, -49), S(-42, -27), S(54, -53), S(-2, -21)},
{S(-210, -69), S(-76, -73), S(-127, -30), S(1, -55)},
{S(-92, -41), S(-19, -51), S(-28, -36), S(-20, -12)},
{S(-21, -25), S(-24, -21), S(-13, -36), S(-14, -17)},
{S(-14, -51), S(-1, -26), S(-8, -19), S(6, 2)},
{S(-6, -12), S(19, -7), S(10, 13), S(9, 19)},
{S(13, -9), S(10, -7), S(27, 16), S(21, 28)},
{S(-23, -16), S(-12, -3), S(12, 22), S(26, 18)},
{S(6, -31), S(-14, -11), S(33, -27), S(44, 6)},
{S(-238, -36), S(-92, -8), S(-150, 26), S(-10, -11)},
},
{ // Bishop
{S(-14, -23), S(13, -8), S(15, -11), S(13, -4)},
{S(11, -30), S(35, -40), S(26, -13), S(14, -7)},
{S(14, -18), S(35, -11), S(17, -12), S(17, 7)},
{S(-1, -25), S(5, -18), S(11, -3), S(22, 2)},
{S(-24, -15), S(-1, -17), S(-8, -1), S(18, 5)},
{S(-40, -9), S(-16, -15), S(-35, -12), S(-22, -5)},
{S(-60, 0), S(-27, -12), S(-12, 5), S(-2, -10)},
{S(-35, -34), S(-29, -16), S(-113, 1), S(-91, 1)},
{S(28, -35), S(33, -3), S(12, -8), S(7, 5)},
{S(29, -49), S(25, -43), S(32, -14), S(15, -4)},
{S(22, -9), S(40, -3), S(12, -16), S(29, 9)},
{S(14, -14), S(22, -2), S(25, 9), S(39, 11)},
{S(-6, 5), S(25, 5), S(16, 14), S(39, 18)},
{S(1, 7), S(-1, 21), S(16, -5), S(25, 15)},
{S(-39, 31), S(-19, 7), S(12, 23), S(0, 29)},
{S(-40, 7), S(-38, 33), S(-111, 45), S(-94, 48)},
},
{ // Rook
{S(-7, -17), S(-11, -5), S(10, -15), S(10, -15)},
{S(-41, 0), S(-3, -17), S(-1, -14), S(3, -14)},
{S(-35, -8), S(-13, -8), S(-2, -17), S(-11, -13)},
{S(-41, 3), S(-9, -3), S(-13, 1), S(-11, -2)},
{S(-37, 9), S(-21, 3), S(11, 7), S(-3, 1)},
{S(-25, 4), S(16, 1), S(12, -2), S(-6, 3)},
{S(-3, 14), S(7, 14), S(48, 2), S(60, -7)},
{S(-2, 13), S(11, 10), S(-21, 18), S(15, 11)},
{S(-15, -27), S(-6, -18), S(1, -17), S(6, -28)},
{S(-58, -12), S(-10, -32), S(-2, -30), S(-11, -29)},
{S(-32, -20), S(-5, -13), S(-16, -13), S(-13, -16)},
{S(-26, 0), S(-12, 9), S(-10, 10), S(-7, 3)},
{S(-10, 12), S(16, 10), S(28, 10), S(37, 6)},
{S(-13, 23), S(53, 4), S(47, 17), S(64, 0)},
{S(4, 27), S(7, 31), S(44, 21), S(50, 29)},
{S(51, 26), S(70, 26), S(45, 33), S(45, 28)},
},
{ // Queen
{S(0, -58), S(16, -72), S(15, -60), S(29, -68)},
{S(-3, -41), S(7, -50), S(26, -56), S(24, -44)},
{S(-6, -14), S(18, -30), S(-4, 5), S(4, -6)},
{S(-3, -18), S(-23, 34), S(-7, 18), S(-18, 44)},
{S(-20, 12), S(-28, 27), S(-29, 31), S(-32, 51)},
{S(20, -26), S(3, -8), S(-4, 13), S(-8, 45)},
{S(-9, -24), S(-54, 17), S(-19, 21), S(-35, 52)},
{S(8, -20), S(2, 0), S(17, 6), S(19, 14)},
{S(13, -104), S(14, -93), S(15, -97), S(21, -65)},
{S(8, -86), S(22, -83), S(24, -94), S(14, -56)},
{S(4, -63), S(18, -31), S(9, 1), S(5, -15)},
{S(3, -23), S(10, 6), S(5, 29), S(-9, 55)},
{S(17, -10), S(10, 36), S(-5, 48), S(-16, 77)},
{S(10, 4), S(20, -1), S(-6, 53), S(8, 47)},
{S(-28, 11), S(-78, 57), S(-12, 49), S(-35, 82)},
{S(-4, 7), S(30, 2), S(28, 31), S(35, 32)},
},
{ // King
{S(177, -18), S(158, 18), S(73, 66), S(66, 110)},
{S(167, 19), S(139, 40), S(65, 77), S(19, 145)},
{S(92, 40), S(135, 45), S(74, 73), S(45, 140)},
{S(47, 36), S(125, 40), S(64, 78), S(49, 138)},
{S(74, 46), S(163, 58), S(86, 87), S(164, 117)},
{S(100, 60), S(285, 56), S(273, 69), S(290, 80)},
{S(79, 67), S(125, 77), S(141, 93), S(213, 103)},
{S(33, 9), S(158, 27), S(109, 71), S(32, 94)},
{S(175, -31), S(155, 16), S(57, 63), S(62, 83)},
{S(168, 27), S(127, 42), S(55, 79), S(27, 135)},
{S(104, 31), S(143, 35), S(111, 67), S(85, 135)},
{S(85, 22), S(235, 27), S(157, 73), S(98, 145)},
{S(89, 41), S(269, 37), S(182, 84), S(112, 144)},
{S(116, 40), S(296, 55), S(250, 80), S(185, 121)},
{S(114, -2), S(210, 63), S(189, 74), S(148, 114)},
{S(157, -98), S(290, -16), S(173, 20), S(161, 78)},
},
}

// Pawns Square scores
var PawnScores = [7][8]Score{
{},
{S(-16, 7), S(11, 0), S(-10, 13), S(9, 4), S(3, 15), S(17, 6), S(32, 0), S(-2, -2)},
{S(-13, -6), S(-17, -2), S(4, -5), S(6, 2), S(4, -3), S(1, 5), S(9, -5), S(-8, -5)},
{S(-14, 6), S(-17, 4), S(14, -7), S(21, -9), S(25, -7), S(4, -2), S(-2, 3), S(-19, 3)},
{S(-6, 15), S(24, -4), S(10, -3), S(34, -16), S(37, -16), S(20, 0), S(36, 5), S(-8, 16)},
{S(10, 40), S(23, 30), S(53, 13), S(47, 1), S(90, -11), S(94, -2), S(56, 20), S(10, 42)},
{S(-2, 57), S(100, 37), S(20, 37), S(17, 34), S(82, 38), S(1, 36), S(-34, 62), S(-116, 105)},
{S(-15, 13), S(0, 2), S(-9, 9), S(-4, 11), S(-14, 18), S(11, 13), S(33, 4), S(2, 4)},
{S(-14, 3), S(-18, 0), S(-6, 0), S(1, -3), S(3, -2), S(-7, 7), S(6, 2), S(-12, 6)},
{S(-8, 13), S(-5, 11), S(15, -7), S(22, -8), S(29, -13), S(16, 1), S(10, 11), S(-14, 14)},
{S(5, 26), S(18, 7), S(4, 5), S(23, -16), S(39, -16), S(40, -4), S(34, 10), S(-4, 25)},
{S(0, 62), S(19, 37), S(32, 21), S(42, -9), S(68, -18), S(83, 5), S(54, 23), S(5, 54)},
{S(-6, 14), S(-8, 10), S(3, 5), S(26, -12), S(33, -18), S(30, -9), S(-90, 30), S(-129, 44)},
}

var PawnsConnected = [7][4]Score{
{S(0, 0), S(0, 0), S(0, 0), S(0, 0)},
{S(10, -20), S(10, 7), S(5, -8), S(4, 19)},
{S(11, 0), S(32, 3), S(14, 8), S(16, 19)},
{S(10, 9), S(29, 5), S(19, 12), S(19, 13)},
{S(13, 16), S(9, 26), S(27, 24), S(31, 23)},
{S(15, 56), S(38, 62), S(61, 61), S(74, 45)},
{S(7, 58), S(150, 0), S(168, 22), S(352, 41)},
{S(1, -15), S(4, 9), S(4, -1), S(15, 19)},
{S(11, 8), S(26, 6), S(24, 13), S(26, 17)},
{S(11, 7), S(25, 7), S(11, 11), S(18, 18)},
{S(6, 16), S(16, 25), S(36, 25), S(30, 18)},
{S(41, 24), S(32, 60), S(78, 60), S(100, 71)},
{S(176, 28), S(300, 20), S(294, 37), S(346, 41)},
}

var MobilityBonus = [...][32]Score{
{S(-42, -117), S(-31, -67), S(-21, -39), S(-18, -19), S(-5, -19), S(5, -9), // Knights
S(14, -11), S(26, -15), S(35, -26)},
{S(-27, -73), S(-8, -59), S(9, -27), S(18, -9), S(28, 1), S(38, 6), // Bishops
S(44, 10), S(47, 12), S(49, 17), S(52, 16), S(66, 0), S(91, 2),
S(50, 23), S(66, 8)},
{S(-28, -35), S(-33, -30), S(-16, 6), S(-5, 37), S(4, 45), S(8, 56), // Rooks
S(11, 66), S(21, 65), S(23, 64), S(36, 68), S(44, 67), S(44, 72),
S(50, 75), S(62, 73), S(90, 61)},
{S(-22, -20), S(-48, -8), S(-4, -141), S(-10, -118), S(-2, -19), S(3, -23), // Queens
S(2, -21), S(11, -5), S(14, 19), S(18, 22), S(18, 36), S(19, 46),
S(27, 37), S(26, 61), S(28, 63), S(28, 75), S(31, 69), S(26, 71),
S(37, 67), S(37, 80), S(65, 55), S(65, 55), S(69, 46), S(61, 33),
S(68, 20), S(28, 36), S(-7, -6), S(5, 3)},
{S(-54, -134), S(-36, -83), S(-19, -41), S(-10, -18), S(-2, -7), S(3, 7), // Knights
S(11, 10), S(20, 5), S(30, -9)},
{S(-4, -141), S(6, -77), S(15, -38), S(24, -13), S(32, 2), S(38, 20), // Bishops
S(41, 29), S(41, 37), S(42, 41), S(47, 45), S(51, 43), S(63, 38),
S(91, 40), S(98, 22)},
{S(-127, -146), S(-12, -38), S(1, 12), S(1, 39), S(6, 49), S(8, 60), // Rooks
S(11, 68), S(16, 70), S(21, 75), S(26, 79), S(30, 83), S(33, 85),
S(39, 84), S(54, 74), S(104, 42)},
{S(-413, -159), S(-122, -138), S(-31, -174), S(-11, -119), S(2, -84), S(2, -13), // Queens
S(8, 6), S(12, 24), S(16, 38), S(20, 50), S(24, 53), S(28, 54),
S(29, 55), S(29, 63), S(32, 56), S(27, 61), S(25, 56), S(20, 57),
S(25, 45), S(32, 27), S(41, 10), S(35, 0), S(38, -21), S(48, -50),
S(14, -38), S(-88, -10), S(127, -127), S(49, -81)},
}

var PassedFriendlyDistance = [8]Score{
S(0, 0), S(-1, 30), S(-4, 12), S(-7, -11),
S(-11, -21), S(-16, -24), S(7, -28), S(-31, -18),
S(0, 0), S(-6, 37), S(-11, 22), S(-10, 8),
S(-4, -7), S(-2, -15), S(14, -26), S(-5, -37),
}

var PassedEnemyDistance = [8]Score{
S(0, 0), S(-58, -58), S(28, -31), S(12, 7),
S(7, 27), S(5, 36), S(5, 39), S(-12, 49),
S(0, 0), S(-130, -58), S(-11, -8), S(7, 10),
S(18, 20), S(16, 28), S(9, 37), S(17, 42),
}

var Psqt [2][King + 1][64]Score
Expand All @@ -130,101 +130,101 @@ var PawnsConnectedSquare [2][64]Score
var pawnsConnectedMask [2][64]uint64

// PassedRank[Rank] contains a bonus according to the rank of a passed pawn
var PassedRank = [7]Score{S(0, 0), S(-4, -33), S(-6, -16), S(-2, 24), S(21, 74), S(35, 162), S(124, 255)}
var PassedRank = [7]Score{S(0, 0), S(-16, -26), S(-25, -9), S(-13, 28), S(26, 66), S(55, 140), S(197, 223)}

// PassedFile[File] contains a bonus according to the file of a passed pawn
var PassedFile = [8]Score{S(0, 25), S(-14, 25), S(-21, 16), S(-24, -3),
S(-20, -1), S(4, 1), S(-12, 20), S(-13, 17),
var PassedFile = [8]Score{S(-2, 29), S(-12, 33), S(-10, 14), S(-9, -2),
S(-13, 1), S(-14, 8), S(-11, 21), S(13, 9),
}

var PassedStacked = [8]Score{S(0, 0), S(17, -37), S(-6, -34), S(-32, -34), S(-68, -35), S(1, -16), S(0, 0), S(0, 0)}
var PassedStacked = [8]Score{S(0, 0), S(-16, -52), S(-21, -35), S(-32, -58), S(-3, -87), S(28, -207), S(0, 0), S(0, 0)}

var Isolated = S(-12, -11)
var Doubled = S(-12, -30)
var Backward = S(5, -2)
var BackwardOpen = S(-15, -5)
var Isolated = S(-8, -14)
var Doubled = S(-11, -30)
var Backward = S(8, -2)
var BackwardOpen = S(-5, -14)

var BishopPair = S(46, 61)
var BishopRammedPawns = S(-6, -16)
var BishopPair = S(23, 87)
var BishopRammedPawns = S(-6, -20)

var BishopOutpostUndefendedBonus = S(43, -1)
var BishopOutpostDefendedBonus = S(80, 6)
var BishopOutpostUndefendedBonus = S(18, 1)
var BishopOutpostDefendedBonus = S(52, 15)

var LongDiagonalBishop = S(18, 14)
var LongDiagonalBishop = S(21, 23)

var KnightOutpostUndefendedBonus = S(33, -16)
var KnightOutpostDefendedBonus = S(54, 15)
var KnightOutpostUndefendedBonus = S(15, -13)
var KnightOutpostDefendedBonus = S(44, 19)

var DistantKnight = [4]Score{S(-17, 12), S(-21, 2), S(-25, -5), S(-18, -2)}
var DistantKnight = [4]Score{S(-12, -2), S(-19, -9), S(-28, -16), S(-53, -20)}

var MinorBehindPawn = S(6, 24)
var MinorBehindPawn = S(8, 34)

var Tempo int16 = 33
var Tempo int16 = 15

// Rook on semiopen, open file
var RookOnFile = [2]Score{S(6, 28), S(51, -2)}
var RookOnQueenFile = S(10, 12)
var RookOnFile = [2]Score{S(9, 17), S(36, 10)}
var RookOnQueenFile = S(7, 29)

var KingDefenders = [12]Score{
S(-79, 7), S(-71, 9), S(-28, 2), S(-5, -2),
S(8, -5), S(20, -7), S(29, 0), S(35, 0),
S(41, 0), S(41, 0), S(11, 0), S(11, 0),
S(-11, -9), S(-5, -7), S(1, -7), S(6, -6),
S(10, -3), S(12, 5), S(15, 10), S(17, 10),
S(16, 8), S(17, -70), S(-3, -10), S(11, 0),
}

var KingShelter = [2][8][8]Score{
{{S(-29, 3), S(-8, -9), S(0, 7), S(33, -8),
S(3, -17), S(2, 1), S(5, -10), S(-29, 12)},
{S(21, -1), S(34, -13), S(-4, -2), S(-2, 6),
S(-24, -2), S(8, -8), S(19, -39), S(-29, 4)},
{S(10, 7), S(1, 2), S(-15, 4), S(-19, 7),
S(-35, 0), S(-15, 1), S(-8, -6), S(-17, -2)},
{S(-16, 21), S(6, 6), S(-9, -6), S(5, -2),
S(10, -22), S(-3, -13), S(8, -41), S(-20, 1)},
{S(0, 7), S(-1, 2), S(-21, 0), S(-23, 9),
S(-14, -8), S(-23, 2), S(-24, -1), S(-25, 4)},
{S(45, -10), S(22, -15), S(-3, -11), S(6, -9),
S(9, -22), S(0, -4), S(31, -26), S(-11, 1)},
{S(25, -1), S(-4, -4), S(-20, -8), S(-8, -4),
S(-11, -9), S(11, -5), S(6, -18), S(-33, 14)},
{S(-22, 1), S(-28, 0), S(-10, 7), S(-16, 12),
S(-5, 7), S(-19, 19), S(-38, 8), S(-59, 36)}},
{{S(0, -2), S(-42, -17), S(-18, -5), S(-78, -22),
S(-5, -17), S(-33, -14), S(-77, 1), S(-67, 19)},
{S(6, 23), S(2, -15), S(-20, -5), S(-6, -4),
S(-3, -1), S(12, -39), S(2, -16), S(-57, 19)},
{S(14, 31), S(42, -5), S(12, -5), S(14, -9),
S(14, 3), S(-21, -9), S(55, -14), S(-28, 6)},
{S(6, 24), S(-31, 19), S(-19, 9), S(-20, 4),
S(-23, 19), S(-71, 31), S(-23, -1), S(-44, 5)},
{S(2, 54), S(1, 4), S(-5, 0), S(-11, -1),
S(-9, 7), S(-1, -10), S(0, -12), S(-37, 5)},
{S(69, -10), S(21, -10), S(-14, 1), S(-5, -14),
S(-4, -6), S(-27, -12), S(17, -28), S(-31, 4)},
{S(1, 11), S(9, -16), S(2, -15), S(-20, -8),
S(-18, -12), S(-5, -16), S(1, -20), S(-68, 19)},
{S(1, 0), S(-3, -26), S(-4, -13), S(-23, -8),
S(-22, -4), S(3, -4), S(-30, -25), S(-64, 26)}},
{{S(-25, 4), S(11, -17), S(21, -8), S(22, -4),
S(23, -15), S(13, -8), S(6, -37), S(-96, 33)},
{S(13, -3), S(27, -15), S(2, -2), S(-7, -3),
S(-3, -6), S(21, -7), S(35, -22), S(-47, 15)},
{S(14, 9), S(1, 5), S(-31, 7), S(-27, 6),
S(-12, -7), S(-9, 12), S(10, 0), S(-37, 6)},
{S(-29, 30), S(10, 7), S(-4, -4), S(2, -5),
S(10, -24), S(4, -5), S(28, 5), S(-15, 3)},
{S(-25, 19), S(-13, 9), S(-33, 10), S(-22, 9),
S(-2, -7), S(-30, 5), S(3, -9), S(-28, 4)},
{S(43, -15), S(23, -13), S(3, -9), S(3, -18),
S(11, -27), S(22, -16), S(30, -20), S(-14, -1)},
{S(23, -9), S(-3, -15), S(-25, -5), S(-17, -2),
S(-13, -19), S(4, -7), S(4, -19), S(-23, 12)},
{S(-36, 6), S(-22, -4), S(-10, 18), S(-17, 19),
S(-25, 15), S(-19, 15), S(-27, -6), S(-71, 43)}},
{{S(48, 42), S(-42, -10), S(-25, -1), S(-40, -1),
S(-51, -12), S(-22, 16), S(-70, 4), S(-89, 37)},
{S(149, 9), S(4, -11), S(-2, 0), S(-26, 14),
S(-16, -13), S(11, -6), S(3, -6), S(-85, 27)},
{S(5, 23), S(44, -11), S(16, -12), S(24, -17),
S(29, -18), S(14, -11), S(45, -10), S(-28, 3)},
{S(6, 50), S(-12, 31), S(-19, 26), S(-25, 28),
S(-3, 15), S(-16, 16), S(-12, 21), S(-45, 4)},
{S(-10, 43), S(-3, 21), S(-6, 14), S(-11, 12),
S(-3, 12), S(4, -11), S(18, -10), S(-32, 6)},
{S(35, 6), S(0, -5), S(-7, -2), S(-1, -3),
S(3, -9), S(-44, -2), S(-7, -13), S(-41, 3)},
{S(44, 0), S(5, -18), S(1, -16), S(-21, -9),
S(-10, -19), S(-3, -16), S(-4, -18), S(-70, 18)},
{S(-5, -4), S(-7, -35), S(0, -22), S(-5, -20),
S(-14, -29), S(-8, -21), S(-18, -41), S(-69, 28)}},
}

var KingStorm = [2][4][8]Score{
{{S(19, 2), S(12, -1), S(16, 0), S(1, 10),
S(-2, 13), S(11, 10), S(0, 17), S(5, -12)},
{S(14, 1), S(11, 3), S(25, 0), S(3, 8),
S(10, 5), S(13, 1), S(6, -1), S(2, -12)},
{S(15, 13), S(11, 8), S(1, 14), S(-9, 17),
S(-3, 14), S(5, 3), S(20, -16), S(9, -5)},
{S(24, 9), S(3, 3), S(6, 1), S(-2, 5),
S(-6, 11), S(5, 8), S(2, 6), S(-5, 1)}},
{{S(0, 0), S(8, 15), S(-17, 7), S(21, -4),
S(16, 12), S(-9, 13), S(7, 44), S(11, -21)},
{S(0, 0), S(7, -28), S(-6, -6), S(58, -11),
S(48, -15), S(-19, 1), S(2, 19), S(6, -20)},
{S(0, 0), S(-73, 0), S(-33, -1), S(13, 2),
S(2, 1), S(-3, -11), S(70, -50), S(7, -2)},
{S(0, 0), S(0, -21), S(12, -17), S(-8, 0),
S(-6, 2), S(8, -20), S(-3, 1), S(-7, 16)}},
{{S(20, 2), S(12, 8), S(16, 2), S(7, 4),
S(-2, 6), S(2, 7), S(-2, 15), S(-7, -8)},
{S(27, -5), S(23, -2), S(25, -4), S(6, 6),
S(14, 0), S(17, -9), S(8, -6), S(-12, -10)},
{S(24, 10), S(8, 5), S(7, 11), S(-1, 14),
S(1, 9), S(12, 0), S(13, -17), S(2, 0)},
{S(11, 12), S(7, 8), S(12, 2), S(-1, -2),
S(-3, 2), S(15, -1), S(10, -4), S(-9, 4)}},
{{S(0, 0), S(19, -6), S(-20, 7), S(8, -8),
S(-3, 18), S(-19, 35), S(4, 53), S(1, -9)},
{S(0, 0), S(-40, -20), S(0, -8), S(41, -8),
S(-1, -4), S(-13, -5), S(13, 56), S(-6, -7)},
{S(0, 0), S(-17, -9), S(-9, -2), S(15, 0),
S(5, -5), S(-7, -19), S(49, -46), S(-4, 7)},
{S(0, 0), S(-13, -18), S(-18, -15), S(-10, -1),
S(1, -19), S(1, -52), S(5, 3), S(-13, 12)}},
}
var KingOnPawnlessFlank = S(14, -60)
var KingOnPawnlessFlank = S(19, -70)

var passedMask [2][64]uint64

Expand All @@ -245,21 +245,21 @@ var forwardFileMask [2][64]uint64
const whiteOutpustRanks = RANK_4_BB | RANK_5_BB | RANK_6_BB
const blackOutpustRanks = RANK_5_BB | RANK_4_BB | RANK_3_BB

var KingSafetyAttacksWeights = [King + 1]int16{0, 0, -4, -1, 5, 0}
var KingSafetyAttackValue int16 = 115
var KingSafetyWeakSquares int16 = 37
var KingSafetyFriendlyPawns int16 = -15
var KingSafetyNoEnemyQueens int16 = -110
var KingSafetySafeQueenCheck int16 = 79
var KingSafetySafeRookCheck int16 = 63
var KingSafetySafeBishopCheck int16 = 51
var KingSafetySafeKnightCheck int16 = 97
var KingSafetyAdjustment int16 = -6

var Hanging = S(57, 51)
var ThreatByKing = S(18, 38)
var ThreatByMinor = [King + 1]Score{S(0, 0), S(24, 23), S(27, 34), S(64, 22), S(48, 45), S(79, 161)}
var ThreatByRook = [King + 1]Score{S(0, 0), S(0, 16), S(-1, 30), S(6, 46), S(91, 31), S(51, 41)}
var KingSafetyAttacksWeights = [King + 1]int16{0, -3, -7, -4, 7, 0}
var KingSafetyAttackValue int16 = 122
var KingSafetyWeakSquares int16 = 43
var KingSafetyFriendlyPawns int16 = -33
var KingSafetyNoEnemyQueens int16 = -160
var KingSafetySafeQueenCheck int16 = 92
var KingSafetySafeRookCheck int16 = 76
var KingSafetySafeBishopCheck int16 = 60
var KingSafetySafeKnightCheck int16 = 113
var KingSafetyAdjustment int16 = -14

var Hanging = S(30, 14)
var ThreatByKing = S(-6, 31)
var ThreatByMinor = [King + 1]Score{S(0, 0), S(22, 40), S(19, 33), S(34, 27), S(31, 30), S(13, 23)}
var ThreatByRook = [King + 1]Score{S(0, 0), S(-2, 11), S(-1, 14), S(-6, -7), S(35, 8), S(23, 1)}

func LoadScoresToPieceSquares() {
for x := 0; x < 4; x++ {
Expand Down

0 comments on commit e467581

Please sign in to comment.