Documentation
¶
Index ¶
Constants ¶
View Source
const ( BlackBlackSquareBishopFlag = 1 << iota BlackWhiteSquareBishopFlag WhiteBlackSquareBishopFlag WhiteWhiteSquareBishopFlag )
View Source
const BishopPhase = 1
View Source
const KnightPhase = 1
View Source
const PawnPhase = 0
View Source
const QueenPhase = 4
View Source
const RookPhase = 2
View Source
const ScaleDraw = 0
View Source
const ScaleHard = 1
View Source
const ScaleNormal = 2
View Source
const TotalPhase = PawnPhase*16 + KnightPhase*4 + BishopPhase*4 + RookPhase*4 + QueenPhase*2
Variables ¶
View Source
var AttackedBySafePawn = [5]Score{
S(42, 73),
S(42, 82),
S(34, 36),
S(36, 27),
S(29, 27),
}
View Source
var Backward = S(8, -2)
View Source
var BackwardOpen = S(-5, -20)
View Source
var BishopFlags [2][2]BishopFlag = [2][2]BishopFlag{{BlackBlackSquareBishopFlag, BlackWhiteSquareBishopFlag}, {WhiteBlackSquareBishopFlag, WhiteWhiteSquareBishopFlag}}
View Source
var BishopOutpostDefendedBonus = S(48, 13)
View Source
var BishopOutpostUndefendedBonus = S(20, -4)
View Source
var BishopPair = S(11, 82)
View Source
var BishopRammedPawns = S(-7, -22)
View Source
var BishopValue = S(379, 550)
View Source
var ComplexityAdjustment = S(0, -173)
View Source
var ComplexityInfiltration = S(0, 6)
View Source
var ComplexityPawnBothFlanks = S(0, 106)
View Source
var ComplexityPawnEndgame = S(0, 83)
View Source
var ComplexityTotalPawns = S(0, 6)
View Source
var DistantBishop = [4]Score{S(-6, 1), S(-10, -1), S(-13, -2), S(-17, -20)}
View Source
var DistantKnight = [4]Score{S(-15, -2), S(-17, -14), S(-29, -15), S(-51, -18)}
View Source
var Hanging = S(23, 11)
View Source
var Isolated = S(-5, -15)
View Source
var KingBishopExistence = [16]Score{
S(0, 0), S(-8, 11), S(-7, 12), S(-24, -3), S(6, -16), S(-2, -6), S(-1, -3), S(-3, 7), S(9, -8), S(1, 3), S(2, 6), S(-1, 15), S(24, 3), S(3, -14), S(5, -10), S(0, 0),
}
View Source
var KingDefenders = [12]Score{
S(-21, -13), S(-3, -11), S(0, -7), S(3, -4),
S(7, -2), S(10, 5), S(13, 10), S(17, 10),
S(17, 13), S(18, -62), S(-16, -12), S(11, 0),
}
View Source
var KingOnPawnlessFlank = S(-29, -69)
View Source
var KingSafetyAdjustment = S(-22, -10)
View Source
var KingSafetyAttackValue = S(116, 132)
Attack value is special as it is scaled by a fraction
View Source
var KingSafetyAttacksWeights = [Queen + 1]Score{S(0, 88), S(-1, -49), S(-7, 78), S(-1, -66), S(0, 87)}
View Source
var KingSafetyFriendlyPawns = S(-32, 4)
View Source
var KingSafetyNoEnemyQueens = S(-150, -182)
View Source
var KingSafetySafeBishopCheck = S(48, 49)
View Source
var KingSafetySafeKnightCheck = S(114, 99)
View Source
var KingSafetySafeQueenCheck = S(89, 106)
View Source
var KingSafetySafeRookCheck = S(78, 90)
View Source
var KingSafetyWeakSquares = S(42, 15)
View Source
var KingShelter = [2][8][8]Score{
{{S(-25, 11), S(9, -12), S(14, 1), S(21, 5),
S(25, -15), S(17, -8), S(15, -39), S(-89, 41)},
{S(18, 9), S(23, -5), S(-5, 11), S(-9, 6),
S(1, -2), S(24, -1), S(40, -17), S(-45, 24)},
{S(16, 3), S(4, 0), S(-24, 0), S(-24, -3),
S(-3, -18), S(1, 0), S(22, -7), S(-30, 0)},
{S(-15, 16), S(9, -3), S(-5, -11), S(-3, -9),
S(2, -24), S(-1, -8), S(16, 22), S(-13, -2)},
{S(-31, 20), S(-13, 8), S(-30, 8), S(-21, 8),
S(2, -8), S(-21, 1), S(10, -4), S(-24, 2)},
{S(38, -18), S(23, -15), S(5, -13), S(3, -23),
S(11, -29), S(24, -18), S(29, -17), S(-11, -2)},
{S(17, -3), S(-5, -9), S(-27, 3), S(-18, 2),
S(-6, -15), S(9, -3), S(15, -15), S(-25, 20)},
{S(-40, 10), S(-25, -2), S(-20, 26), S(-21, 23),
S(-22, 15), S(-12, 11), S(-13, -15), S(-70, 51)}},
{{S(34, 57), S(-35, -12), S(-27, 4), S(-28, -7),
S(-40, -16), S(-7, 5), S(-41, -17), S(-88, 41)},
{S(137, 18), S(6, -4), S(-5, 7), S(-26, 18),
S(-7, -12), S(13, 2), S(14, -2), S(-78, 28)},
{S(-4, 34), S(33, 6), S(11, 0), S(15, -7),
S(24, -8), S(10, 4), S(38, 8), S(-23, 6)},
{S(5, 35), S(-11, 21), S(-12, 14), S(-21, 22),
S(-4, 10), S(-5, 5), S(-4, 11), S(-38, -3)},
{S(4, 21), S(-1, 8), S(-6, 3), S(-11, -1),
S(-2, -1), S(1, -10), S(10, 1), S(-30, -5)},
{S(17, 20), S(-5, 7), S(-17, 9), S(-11, 8),
S(-4, 3), S(-36, 12), S(-8, 4), S(-37, 10)},
{S(29, 4), S(-4, -16), S(-9, -13), S(-26, -9),
S(-11, -18), S(0, -15), S(1, -17), S(-71, 22)},
{S(-27, -3), S(-12, -34), S(-8, -19), S(-3, -25),
S(-4, -38), S(-2, -24), S(-5, -50), S(-65, 30)}},
}
View Source
var KingStorm = [2][8][8]Score{
{
{S(11, 12), S(-3, 20), S(5, 16), S(4, 21),
S(8, 7), S(7, 6), S(5, 15), S(-10, -11)},
{S(16, 12), S(14, 10), S(31, 2), S(-4, 16),
S(10, 1), S(40, -19), S(19, -10), S(-6, -6)},
{S(14, 19), S(8, 12), S(12, 12), S(-3, 14),
S(-5, 11), S(13, 4), S(15, 2), S(-2, 5)},
{S(6, 4), S(9, -2), S(7, -10), S(0, -14),
S(-6, -9), S(11, -18), S(7, -11), S(-8, 4)},
{S(14, 0), S(8, -2), S(16, -12), S(1, -13),
S(0, -6), S(19, -13), S(9, -11), S(-15, 5)},
{S(24, 9), S(4, 6), S(4, 10), S(1, 12),
S(5, 9), S(10, 4), S(6, -5), S(-3, 6)},
{S(26, -2), S(17, 5), S(18, 2), S(10, 8),
S(22, 2), S(26, -7), S(19, -5), S(-6, -6)},
{S(13, 6), S(4, 14), S(9, 5), S(5, 6),
S(4, 4), S(12, 0), S(7, 10), S(-11, -7)},
},
{
{S(0, 0), S(1, 0), S(-15, -3), S(25, -9),
S(1, 13), S(-1, 15), S(4, 51), S(-3, -25)},
{S(0, 0), S(-53, -22), S(-33, 1), S(40, -8),
S(2, -2), S(3, -7), S(12, 52), S(-10, 0)},
{S(0, 0), S(-18, -8), S(-19, -11), S(10, -9),
S(1, -6), S(-12, -17), S(28, 1), S(-12, 1)},
{S(0, 0), S(-18, -29), S(-18, -23), S(-13, -8),
S(1, -28), S(1, -47), S(4, -1), S(-13, -6)},
{S(0, 0), S(-14, -28), S(-8, -28), S(-3, -12),
S(3, -21), S(-1, -55), S(3, -3), S(-8, -6)},
{S(0, 0), S(-17, -15), S(0, -5), S(16, 2),
S(6, -4), S(-7, -17), S(29, -37), S(-6, 6)},
{S(0, 0), S(-45, -12), S(18, -10), S(48, -8),
S(7, -2), S(-8, -6), S(10, 51), S(-5, -4)},
{S(0, 0), S(5, 0), S(-14, 7), S(9, -8),
S(-2, 21), S(-12, 32), S(2, 54), S(-8, -6)},
},
}
View Source
var KnightOutpostDefendedBonus = S(41, 13)
View Source
var KnightOutpostUndefendedBonus = S(19, -24)
View Source
var KnightValue = S(394, 569)
View Source
var LongDiagonalBishop = S(21, 25)
View Source
var MinorBehindPawn = S(7, 28)
View Source
var MobilityBonus = [...][32]Score{
{S(-65, -123), S(-49, -65), S(-34, -17), S(-25, 5), S(-18, 18), S(-14, 34),
S(-6, 37), S(3, 33), S(13, 18)},
{S(1, -122), S(7, -55), S(15, -15), S(21, 7), S(28, 20), S(33, 35),
S(35, 43), S(35, 47), S(35, 49), S(39, 49), S(42, 44), S(52, 36),
S(69, 37), S(76, 10)},
{S(-110, -156), S(-15, -25), S(-5, 25), S(-6, 52), S(-2, 60), S(0, 73),
S(1, 83), S(4, 90), S(8, 96), S(10, 102), S(13, 109), S(15, 116),
S(20, 117), S(34, 104), S(89, 61)},
{S(-413, -159), S(-130, -143), S(-42, -178), S(-23, -116), S(-10, -79), S(-11, -11),
S(-7, 17), S(-4, 36), S(0, 52), S(4, 65), S(6, 73), S(10, 75),
S(12, 77), S(13, 83), S(16, 78), S(13, 83), S(12, 79), S(10, 79),
S(13, 68), S(18, 56), S(31, 33), S(34, 15), S(37, -1), S(50, -39),
S(23, -28), S(-58, -7), S(140, -118), S(56, -79)},
}
View Source
var PassedEnemyDistance = [8]Score{
S(0, 0), S(-76, -47), S(0, -14), S(4, 5),
S(9, 17), S(7, 25), S(4, 33), S(14, 36),
}
View Source
var PassedFile = [8]Score{S(-1, 24), S(-2, 28), S(-2, 11), S(-5, -3),
S(-11, 2), S(-18, 7), S(-17, 19), S(7, 5),
}
PassedFile[File] contains a bonus according to the file of a passed pawn
View Source
var PassedFriendlyDistance = [8]Score{
S(0, 0), S(0, 36), S(-8, 23), S(-8, 8),
S(-4, -7), S(-1, -18), S(13, -31), S(1, -42),
}
View Source
var PassedPushDefended = [6]Score{S(0, 0), S(-2, 19), S(0, 6), S(5, 1), S(-3, 5), S(-16, 16)}
View Source
var PassedPushUncontestedDefended = [6]Score{S(0, 0), S(-58, 37), S(-36, 25), S(-63, 50), S(-71, 63), S(-59, 78)}
View Source
var PassedRank = [2][2][2][7]Score{
{
{
{S(0, 0), S(-45, -27), S(-35, 5), S(-21, 12), S(32, 14), S(45, 16), S(169, 88)},
{S(0, 0), S(-31, -58), S(-28, -25), S(-15, 3), S(31, 24), S(60, 34), S(165, 128)},
},
{
{S(0, 0), S(-17, -29), S(-27, 0), S(-16, 20), S(15, 47), S(54, 83), S(247, 140)},
{S(0, 0), S(-7, -54), S(-24, -6), S(-17, 24), S(14, 59), S(72, 88), S(222, 178)},
},
},
{
{
{S(0, 0), S(-18, -9), S(-28, -4), S(-8, 21), S(30, 48), S(63, 98), S(269, 181)},
{S(0, 0), S(-14, -23), S(-18, -6), S(-7, 35), S(37, 65), S(75, 107), S(226, 224)},
},
{
{S(0, 0), S(-28, -14), S(-25, -13), S(-11, 30), S(22, 85), S(32, 232), S(75, 413)},
{S(0, 0), S(-13, -34), S(-16, -16), S(-9, 32), S(22, 92), S(55, 219), S(133, 428)},
},
},
}
PassedRank[Rank] contains a bonus according to the rank of a passed pawn, whether it can be pushed and whether the push would be safe
View Source
var PassedStacked = [7]Score{S(0, 0), S(-18, -63), S(-29, -46), S(-46, -63), S(-32, -69), S(39, -108), S(0, 0)}
View Source
var PassedUncontested = [6]Score{S(0, 0), S(-83, 44), S(-71, 42), S(-81, 46), S(-79, 50), S(-64, 39)}
View Source
var PawnPsqt [16][2][64]Score // BishopFlag, colour, Square
View Source
var PawnScores = [16][7][8]Score{
{
{},
{S(-16, 18), S(-9, 8), S(-18, 16), S(-4, 16), S(-17, 25), S(17, 23), S(31, 17), S(-10, 19)},
{S(-15, 9), S(-15, 7), S(-16, 6), S(-3, 1), S(-2, 2), S(-2, 13), S(4, 16), S(-17, 18)},
{S(-15, 20), S(-19, 17), S(1, 0), S(8, -9), S(16, -12), S(17, 7), S(0, 26), S(-16, 28)},
{S(-8, 33), S(-2, 18), S(-4, 4), S(6, -11), S(26, -14), S(29, 8), S(30, 25), S(-2, 35)},
{S(2, 56), S(12, 38), S(20, 27), S(47, -6), S(65, -14), S(66, 24), S(67, 41), S(8, 63)},
{S(10, 0), S(-20, 32), S(3, 24), S(19, 1), S(-19, 9), S(-15, 24), S(-123, 67), S(-139, 57)},
},
{
{},
{S(-12, 26), S(-5, 6), S(-18, 10), S(10, 16), S(-15, 19), S(28, 17), S(26, 2), S(-8, 13)},
{S(-9, 10), S(-15, 1), S(-3, 5), S(0, -6), S(9, 10), S(-4, -1), S(13, 13), S(-20, 10)},
{S(-6, 19), S(-9, 12), S(5, -7), S(27, -6), S(23, -18), S(28, 2), S(2, 14), S(-11, 13)},
{S(3, 32), S(13, 4), S(14, 5), S(18, -24), S(38, -12), S(43, -10), S(27, 18), S(-11, 32)},
{S(-14, 83), S(33, 25), S(23, 26), S(67, -19), S(60, -17), S(101, -9), S(41, 27), S(-1, 50)},
{S(-22, 66), S(10, 6), S(28, 6), S(16, -8), S(57, -12), S(16, -26), S(-83, 33), S(-107, 28)},
},
{
{},
{S(-18, 16), S(-13, 15), S(-14, 22), S(-14, 3), S(6, 28), S(10, 9), S(47, 7), S(-7, 20)},
{S(-20, 9), S(-21, 9), S(-12, -3), S(0, 7), S(5, -13), S(4, 15), S(-1, -1), S(-17, 19)},
{S(-12, 7), S(-10, 10), S(7, 4), S(17, -15), S(38, -13), S(24, -6), S(6, 16), S(-13, 22)},
{S(-8, 23), S(0, 14), S(-2, 1), S(22, -9), S(34, -17), S(55, -1), S(22, 14), S(-5, 32)},
{S(0, 47), S(8, 38), S(61, -9), S(44, -10), S(96, -29), S(68, 23), S(26, 28), S(6, 66)},
{S(-32, 19), S(-18, 42), S(12, -21), S(21, 6), S(27, -29), S(30, -22), S(-91, 27), S(-100, 29)},
},
{
{},
{S(-17, 6), S(-10, -6), S(-2, -6), S(6, -18), S(10, -1), S(14, -1), S(43, -9), S(1, -16)},
{S(-11, -5), S(-26, -5), S(-2, -8), S(-1, -10), S(11, -7), S(-5, -3), S(6, -12), S(-7, -22)},
{S(-2, -9), S(-6, -12), S(11, -24), S(33, -19), S(31, -17), S(24, -10), S(23, -24), S(4, -26)},
{S(-17, 18), S(-1, -4), S(32, -45), S(18, -16), S(39, -42), S(42, -23), S(19, 4), S(-5, -12)},
{S(-26, 76), S(13, 17), S(41, -25), S(24, 1), S(83, -32), S(40, 7), S(38, 13), S(-16, 31)},
{S(-15, 34), S(-28, 33), S(-27, 9), S(17, -36), S(52, 0), S(44, -8), S(-91, 32), S(-120, 71)},
},
{
{},
{S(-19, 18), S(-11, 18), S(-5, 6), S(-2, 14), S(-19, 21), S(7, 19), S(34, 11), S(-10, 17)},
{S(-15, 7), S(-20, 4), S(-7, -17), S(3, -7), S(-7, -11), S(-7, 13), S(0, 4), S(-17, 19)},
{S(-16, 25), S(-5, 10), S(10, -9), S(13, -31), S(30, -30), S(12, -8), S(4, 21), S(-17, 30)},
{S(-5, 47), S(8, 17), S(3, -12), S(21, -17), S(31, -41), S(34, 8), S(28, 13), S(-12, 50)},
{S(-24, 88), S(4, 43), S(6, 31), S(63, -21), S(70, -17), S(81, -4), S(56, 41), S(4, 71)},
{S(37, 40), S(-27, 43), S(5, 25), S(42, 18), S(73, -36), S(52, 17), S(-78, 62), S(-125, 98)},
},
{
{},
{S(-4, 30), S(2, 17), S(-8, 21), S(0, 19), S(-7, 24), S(15, 32), S(25, 10), S(-2, 17)},
{S(-5, 18), S(-8, 4), S(0, 8), S(5, -6), S(6, 9), S(-3, 9), S(5, 19), S(-12, 15)},
{S(-2, 32), S(5, 17), S(15, -4), S(27, -9), S(34, -16), S(22, 10), S(7, 23), S(-10, 25)},
{S(13, 43), S(17, 14), S(7, 13), S(29, -15), S(43, -20), S(45, -4), S(35, 30), S(-9, 44)},
{S(-8, 97), S(28, 43), S(33, 34), S(65, -18), S(74, -22), S(80, 6), S(29, 48), S(-5, 73)},
{S(15, 67), S(-38, 21), S(11, 41), S(51, 17), S(22, -2), S(51, 31), S(-52, 21), S(-132, 48)},
},
{
{},
{S(-4, -18), S(1, -12), S(-3, -8), S(6, -26), S(4, 4), S(7, -17), S(46, 1), S(1, -9)},
{S(-4, -20), S(-8, -13), S(-10, -33), S(3, -15), S(-5, -33), S(4, -6), S(-8, -22), S(-6, -3)},
{S(-4, -11), S(7, -32), S(16, -22), S(13, -58), S(36, -34), S(12, -29), S(14, -3), S(-9, 7)},
{S(7, -5), S(8, -4), S(8, -43), S(20, -21), S(35, -65), S(69, -26), S(30, -19), S(16, 7)},
{S(-6, 21), S(45, -10), S(23, -10), S(47, -34), S(80, -55), S(95, -50), S(85, -18), S(46, 10)},
{S(88, -86), S(5, 21), S(19, -84), S(27, -11), S(76, -106), S(21, 3), S(-34, -120), S(-111, 21)},
},
{
{},
{S(-6, 5), S(-4, 14), S(-4, 8), S(1, 5), S(4, 19), S(7, 16), S(31, 17), S(-3, 13)},
{S(-7, 2), S(-17, 6), S(-6, -1), S(1, 4), S(5, -5), S(-10, 26), S(-1, 2), S(-10, -2)},
{S(-3, 8), S(-3, 5), S(15, -9), S(27, -23), S(30, -7), S(13, 9), S(6, 12), S(-12, 16)},
{S(8, 28), S(13, 16), S(6, 6), S(23, -5), S(36, -27), S(50, -7), S(17, 15), S(-13, 22)},
{S(-5, 56), S(25, 30), S(15, 23), S(43, 14), S(82, -33), S(82, 17), S(21, -10), S(-5, 78)},
{S(12, -6), S(-41, 20), S(-21, -2), S(58, -8), S(-27, -55), S(33, -39), S(-64, 39), S(-135, 18)},
},
{
{},
{S(-14, 22), S(-6, 7), S(-13, 13), S(-6, 6), S(-12, 13), S(13, 13), S(22, 10), S(-9, 18)},
{S(-12, 10), S(-14, 0), S(-10, -3), S(-1, -16), S(1, -7), S(-16, 3), S(4, 13), S(-15, 13)},
{S(-9, 27), S(-10, 20), S(1, -16), S(18, -27), S(21, -35), S(13, 1), S(-5, 18), S(-17, 27)},
{S(-1, 55), S(10, 10), S(-3, 1), S(10, -35), S(32, -15), S(22, -15), S(22, 24), S(-18, 41)},
{S(11, 75), S(9, 45), S(61, 3), S(45, -19), S(65, -20), S(84, 15), S(96, 23), S(-7, 63)},
{S(-32, 59), S(-12, 36), S(44, 17), S(44, -18), S(38, 23), S(42, -16), S(-86, 22), S(-123, 64)},
},
{
{},
{S(5, -3), S(7, -23), S(-5, -9), S(27, -4), S(-3, -10), S(36, 1), S(32, -22), S(9, -14)},
{S(2, -12), S(0, -31), S(14, -21), S(8, -33), S(21, -9), S(-6, -17), S(20, -3), S(-1, -22)},
{S(6, 5), S(1, -16), S(18, -49), S(38, -29), S(32, -57), S(41, -16), S(12, -16), S(2, -7)},
{S(21, 10), S(28, -32), S(19, -26), S(20, -68), S(53, -41), S(39, -44), S(35, 1), S(5, -3)},
{S(40, 29), S(20, 1), S(55, -21), S(74, -44), S(84, -55), S(136, -49), S(69, -18), S(28, 4)},
{S(1, 18), S(36, -73), S(7, 46), S(53, -80), S(17, -31), S(66, -119), S(-100, -9), S(-116, -71)},
},
{
{},
{S(-7, 27), S(-1, 17), S(-7, 30), S(-7, 20), S(-13, 34), S(12, 16), S(28, 21), S(-3, 14)},
{S(-10, 20), S(-7, 12), S(-7, 11), S(4, 6), S(2, -7), S(-5, 18), S(3, 12), S(-12, 13)},
{S(-1, 24), S(1, 22), S(15, 3), S(18, -4), S(31, -9), S(23, 4), S(10, 19), S(-11, 24)},
{S(1, 47), S(18, 24), S(8, 9), S(20, -9), S(37, -18), S(49, -3), S(27, 20), S(-7, 40)},
{S(7, 76), S(15, 66), S(42, 10), S(34, 9), S(88, -22), S(74, 30), S(90, 9), S(2, 68)},
{S(-13, 47), S(-12, 67), S(-13, 15), S(27, 18), S(80, -15), S(66, -50), S(-89, 26), S(-156, 75)},
},
{
{},
{S(-8, 21), S(0, 9), S(-4, 14), S(11, 18), S(-10, 27), S(18, 15), S(27, 0), S(0, 2)},
{S(-7, 9), S(-10, 7), S(-4, 18), S(3, -3), S(7, 9), S(-7, 4), S(7, 3), S(-10, 1)},
{S(1, 22), S(5, 6), S(14, -10), S(28, 1), S(32, -23), S(28, 5), S(8, 4), S(-13, 10)},
{S(14, 23), S(19, 23), S(13, 18), S(26, -43), S(37, -20), S(49, -24), S(17, 21), S(-18, 39)},
{S(0, 80), S(23, 54), S(32, 8), S(43, -17), S(61, -11), S(87, -13), S(40, 43), S(2, 34)},
{S(-16, -8), S(3, 27), S(9, 5), S(21, 5), S(34, -7), S(37, 0), S(-88, 35), S(-117, 35)},
},
{
{},
{S(-25, 25), S(-14, 17), S(-4, 1), S(-4, 4), S(-21, -12), S(2, 5), S(21, -6), S(1, -7)},
{S(-20, 22), S(-25, 11), S(-24, 1), S(-3, -11), S(2, -29), S(-6, -12), S(0, -4), S(-5, -2)},
{S(-13, 34), S(-15, 18), S(5, -26), S(8, -35), S(24, -60), S(23, -27), S(-8, 17), S(-4, 9)},
{S(-8, 39), S(1, 30), S(-3, 7), S(19, -32), S(26, -28), S(41, -49), S(18, 20), S(3, 38)},
{S(-23, 131), S(-2, 74), S(3, 47), S(48, 15), S(63, -2), S(84, 2), S(70, 31), S(-18, 107)},
{S(-15, 49), S(-13, 39), S(-16, 36), S(-1, -8), S(15, -9), S(30, -45), S(-52, 33), S(-93, 78)},
},
{
{},
{S(-8, 32), S(1, 13), S(-8, 12), S(1, 9), S(-13, 12), S(13, 28), S(15, 2), S(-1, 3)},
{S(-8, 22), S(-15, 2), S(2, 4), S(5, -27), S(7, 4), S(-6, -5), S(3, 7), S(-11, -3)},
{S(0, 35), S(-2, 18), S(16, -21), S(25, -10), S(32, -41), S(23, 2), S(6, 2), S(-7, 5)},
{S(13, 54), S(15, 12), S(13, 10), S(28, -50), S(41, -15), S(32, -25), S(33, 21), S(-8, 35)},
{S(9, 88), S(24, 75), S(26, 40), S(38, 16), S(36, 31), S(87, -14), S(35, 35), S(3, 66)},
{S(11, 99), S(-30, 48), S(-3, 30), S(33, -15), S(30, -5), S(-11, -50), S(-120, -9), S(-106, 83)},
},
{
{},
{S(-16, 23), S(-4, 13), S(-6, 23), S(0, 4), S(-20, 25), S(-1, 6), S(20, 23), S(-6, 18)},
{S(-14, 8), S(-10, 9), S(-6, -22), S(2, -1), S(-8, -17), S(-7, 9), S(-4, -3), S(-13, 17)},
{S(-11, 27), S(-3, 15), S(14, -2), S(16, -37), S(31, -21), S(15, -14), S(7, 7), S(-15, 19)},
{S(-5, 50), S(20, 27), S(1, -5), S(20, -2), S(33, -47), S(52, -22), S(24, -1), S(-9, 44)},
{S(-1, 110), S(16, 45), S(45, 30), S(28, 5), S(89, -17), S(60, 13), S(47, 31), S(6, 61)},
{S(-13, 14), S(-17, 76), S(-52, 29), S(10, 26), S(8, -24), S(28, 10), S(-76, 21), S(-134, 64)},
},
{
{},
{S(-9, 25), S(-1, 29), S(-11, 29), S(-4, 17), S(-16, 18), S(2, 32), S(13, 21), S(-9, 19)},
{S(-9, 20), S(-13, 17), S(-6, 16), S(-2, 10), S(-1, 11), S(-15, 35), S(-9, 18), S(-19, 17)},
{S(-1, 27), S(0, 27), S(13, 7), S(19, 3), S(27, -12), S(15, 14), S(0, 23), S(-20, 27)},
{S(9, 54), S(20, 27), S(3, 32), S(22, -16), S(30, -7), S(40, -7), S(17, 29), S(-16, 42)},
{S(5, 96), S(18, 72), S(13, 75), S(42, 10), S(56, -15), S(59, -1), S(28, 28), S(-10, 70)},
{S(-90, 112), S(-74, 21), S(-37, 47), S(5, 1), S(15, -41), S(32, 3), S(-60, 16), S(-162, 25)},
},
}
Pawns Square scores Bishop Flag, Rank, Row
View Source
var PawnValue = S(78, 168)
View Source
var PawnsConnected = [7][4]Score{
{S(0, 0), S(0, 0), S(0, 0), S(0, 0)},
{S(-1, -16), S(8, 3), S(2, -2), S(14, 16)},
{S(11, 4), S(21, 3), S(23, 10), S(25, 15)},
{S(9, 5), S(20, 10), S(10, 11), S(15, 21)},
{S(4, 18), S(15, 25), S(27, 31), S(28, 24)},
{S(36, 31), S(20, 74), S(63, 77), S(70, 95)},
{S(176, 38), S(280, 20), S(275, 58), S(315, 56)},
}
View Source
var PawnsConnectedSquare [2][64]Score
View Source
var PieceScores = [King + 1][8][8]Score{
{},
{
{S(-77, -90), S(-25, -44), S(-44, -33), S(-25, -3), S(-28, -10), S(-29, -31), S(-31, -32), S(-83, -44)},
{S(-31, -33), S(-19, -21), S(-18, -36), S(-20, -10), S(-28, -12), S(-21, -30), S(-29, -15), S(-26, -21)},
{S(-15, -45), S(-10, -18), S(-10, -11), S(-6, 10), S(-5, 10), S(-19, -11), S(-9, -21), S(-25, -44)},
{S(-12, -3), S(-9, 8), S(5, 24), S(-6, 37), S(7, 34), S(-2, 28), S(19, 1), S(-14, 4)},
{S(-4, 10), S(-4, 9), S(7, 36), S(6, 55), S(5, 48), S(21, 33), S(6, 12), S(7, 9)},
{S(-50, 6), S(-27, 18), S(-6, 43), S(4, 44), S(22, 34), S(19, 37), S(-15, 11), S(-19, -2)},
{S(-1, -23), S(-15, -5), S(19, -17), S(26, 19), S(33, 11), S(54, -38), S(-26, -5), S(11, -37)},
{S(-203, -56), S(-98, -11), S(-154, 26), S(-32, -7), S(7, -9), S(-128, 31), S(-75, -11), S(-191, -75)},
},
{
{S(32, -40), S(48, -13), S(7, 0), S(12, 3), S(-2, 11), S(13, -7), S(12, -13), S(21, -40)},
{S(44, -38), S(21, -36), S(44, -10), S(9, 4), S(16, 1), S(16, -14), S(31, -40), S(20, -64)},
{S(20, -9), S(49, 0), S(8, -5), S(33, 14), S(16, 20), S(16, -13), S(28, 1), S(30, -9)},
{S(15, -6), S(19, 9), S(32, 18), S(23, 28), S(43, 22), S(13, 22), S(24, 7), S(6, -4)},
{S(-13, 21), S(29, 16), S(1, 31), S(41, 34), S(22, 38), S(27, 24), S(12, 22), S(2, 16)},
{S(5, 12), S(-11, 34), S(14, 7), S(8, 35), S(26, 32), S(-2, 21), S(10, 32), S(-5, 20)},
{S(-27, 31), S(-6, 9), S(11, 26), S(-14, 40), S(-11, 41), S(13, 30), S(-20, 10), S(-26, 30)},
{S(-22, -3), S(-64, 41), S(-126, 51), S(-106, 61), S(-106, 55), S(-100, 49), S(23, 18), S(-42, 2)},
},
{
{S(-23, -28), S(-20, -17), S(-11, -17), S(-3, -27), S(-4, -30), S(-6, -17), S(-3, -28), S(-8, -49)},
{S(-58, -23), S(-25, -33), S(-22, -26), S(-20, -30), S(-20, -31), S(-2, -39), S(5, -47), S(-51, -21)},
{S(-42, -15), S(-29, -1), S(-34, -4), S(-21, -14), S(-22, -13), S(-16, -11), S(10, -20), S(-22, -22)},
{S(-39, 9), S(-34, 26), S(-29, 24), S(-17, 13), S(-22, 12), S(-15, 16), S(-5, 10), S(-14, 1)},
{S(-32, 35), S(-7, 32), S(2, 32), S(27, 21), S(7, 23), S(20, 20), S(17, 16), S(1, 21)},
{S(-37, 47), S(17, 28), S(11, 39), S(36, 21), S(38, 19), S(61, 30), S(79, 2), S(6, 31)},
{S(-29, 57), S(-20, 57), S(8, 49), S(30, 49), S(13, 54), S(62, 19), S(13, 37), S(23, 30)},
{S(16, 44), S(28, 48), S(1, 57), S(11, 48), S(11, 51), S(58, 44), S(73, 38), S(58, 43)},
},
{
{S(3, -106), S(-3, -80), S(-1, -81), S(3, -46), S(4, -80), S(-15, -77), S(3, -122), S(3, -112)},
{S(-3, -80), S(3, -61), S(10, -79), S(2, -42), S(2, -49), S(16, -96), S(22, -105), S(14, -92)},
{S(-5, -59), S(6, -27), S(2, -4), S(-6, -8), S(-5, -14), S(2, 4), S(16, -39), S(8, -55)},
{S(-3, -51), S(-5, 3), S(-10, 12), S(-16, 65), S(-18, 53), S(7, 41), S(7, 7), S(11, 10)},
{S(-25, -23), S(-17, 21), S(-30, 22), S(-24, 75), S(-29, 100), S(0, 91), S(15, 74), S(12, 49)},
{S(-44, -5), S(-29, -4), S(-31, 19), S(-12, 39), S(6, 74), S(47, 75), S(51, 58), S(22, 81)},
{S(-47, 16), S(-80, 41), S(-29, 24), S(-61, 75), S(-38, 111), S(24, 85), S(-35, 82), S(12, 32)},
{S(-42, 24), S(-10, 15), S(-13, 49), S(12, 46), S(15, 62), S(60, 51), S(87, 20), S(60, 14)},
},
{
{S(141, -9), S(128, 25), S(54, 62), S(61, 64), S(77, 46), S(60, 61), S(151, 18), S(166, -32)},
{S(152, 36), S(102, 54), S(43, 90), S(39, 111), S(35, 120), S(53, 88), S(127, 48), S(156, 33)},
{S(114, 28), S(150, 44), S(89, 83), S(87, 120), S(71, 130), S(98, 83), S(138, 47), S(105, 36)},
{S(142, 12), S(262, 32), S(156, 91), S(85, 140), S(89, 144), S(142, 94), S(215, 44), S(95, 29)},
{S(134, 50), S(324, 43), S(159, 108), S(112, 137), S(90, 147), S(194, 101), S(265, 51), S(102, 51)},
{S(141, 47), S(324, 65), S(222, 103), S(173, 111), S(174, 118), S(253, 94), S(300, 64), S(137, 42)},
{S(136, -4), S(223, 61), S(212, 75), S(177, 88), S(127, 96), S(174, 77), S(203, 67), S(125, -4)},
{S(180, -123), S(312, -39), S(201, 1), S(173, 54), S(154, 52), S(167, 10), S(286, -28), S(145, -102)},
},
}
Piece Square Values
View Source
var Psqt [2][King + 1][64]Score // One row for every colour purposefelly left empty
View Source
var QueenBishopExistence = [16]Score{
S(76, -33), S(-3, -8), S(-2, -21), S(-32, -14), S(-3, -2), S(10, 77), S(-21, 0), S(-4, -5), S(-1, 3), S(-19, 24), S(10, 73), S(-2, 4), S(-38, -9), S(-8, 39), S(-12, 31), S(-23, 32),
}
View Source
var QueenPinned = S(-36, -7)
View Source
var QueenValue = S(1191, 1782)
View Source
var RookBishopExistence = [16]Score{
S(9, -2), S(0, -5), S(0, -5), S(0, -2), S(-1, -4), S(-8, 37), S(-4, 0), S(-7, 20), S(1, -5), S(-4, -2), S(-8, 38), S(-7, 22), S(-5, -19), S(-3, 18), S(-1, 18), S(-19, 56),
}
This weights are from black piece on black square perspective
View Source
var RookOnFile = [2]Score{S(13, 12), S(38, 6)}
Rook on semiopen, open file
View Source
var RookOnQueenFile = S(-1, 21)
View Source
var RookValue = S(512, 946)
View Source
var SEEValues = [...]int{100, 450, 450, 675, 1300, Mate / 2, 0}
View Source
var StackedPawns = [2][2][8]Score{
{
{S(-14, -44), S(-15, -25), S(-4, -26), S(-8, -17), S(-17, -19), S(-2, -27), S(6, -36), S(13, -50)},
{S(-19, -47), S(-12, -24), S(-4, -20), S(-17, -19), S(-19, -13), S(-7, -28), S(-7, -34), S(5, -56)},
},
{
{S(-19, -53), S(-15, -27), S(-17, -37), S(-25, -42), S(-18, -32), S(2, -39), S(-5, -40), S(-8, -63)},
{S(-25, -59), S(-4, -39), S(-22, -35), S(-22, -31), S(-21, -33), S(-4, -46), S(5, -49), S(-17, -70)},
},
}
Is doubled, can be traded
View Source
var Tempo int16 = 15
View Source
var ThreatByKing = S(-5, 36)
View Source
var ThreatByMinor = [King + 1]Score{S(0, 0), S(19, 41), S(17, 39), S(31, 31), S(32, 30), S(3, 28)}
View Source
var ThreatByRook = [King + 1]Score{S(0, 0), S(-5, 13), S(-3, 18), S(-5, -9), S(40, 13), S(15, 9)}
View Source
var TrappedRook = S(-36, 4)
Functions ¶
func LoadScoresToPieceSquares ¶
func LoadScoresToPieceSquares()
Types ¶
type BishopFlag ¶
type BishopFlag uint8
func (BishopFlag) BlackPawnPerspective ¶
func (f BishopFlag) BlackPawnPerspective() BishopFlag
type EvaluationContext ¶
type EvaluationContext struct { registeel.RegisteelNetwork // contains filtered or unexported fields }
func (*EvaluationContext) Evaluate ¶
func (ec *EvaluationContext) Evaluate(pos *Position) int
func (*EvaluationContext) SetContempt ¶
func (ec *EvaluationContext) SetContempt(contempt Score)
type PKTableEntry ¶
type PKTableEntry struct {
// contains filtered or unexported fields
}
type PawnKingTable ¶
type PawnKingTable struct { Entries []PKTableEntry Mask uint64 }
var GlobalPawnKingTable PawnKingTable
func NewPawnKingTable ¶
func NewPawnKingTable(megabytes int) PawnKingTable
func (*PawnKingTable) Clear ¶
func (t *PawnKingTable) Clear()
func (*PawnKingTable) Get ¶
func (t *PawnKingTable) Get(key uint64) (ok bool, score Score)
func (*PawnKingTable) Set ¶
func (t *PawnKingTable) Set(key uint64, score Score)
type Trace ¶
type Trace struct { PawnValue int KnightValue int BishopValue int RookValue int QueenValue int PawnScores [16][7][8]int PieceScores [King + 1][8][8]int PawnsConnected [7][4]int MobilityBonus [4][32]int PassedFriendlyDistance [8]int PassedEnemyDistance [8]int PassedRank [2][2][2][7]int PassedFile [8]int PassedStacked [7]int PassedUncontested [6]int PassedPushDefended [6]int PassedPushUncontestedDefended [6]int Isolated int StackedPawns [2][2][8]int AttackedBySafePawn [5]int Backward int BackwardOpen int BishopPair int BishopRammedPawns int BishopOutpostUndefendedBonus int BishopOutpostDefendedBonus int LongDiagonalBishop int DistantBishop [4]int KnightOutpostUndefendedBonus int KnightOutpostDefendedBonus int DistantKnight [4]int MinorBehindPawn int QueenPinned int RookOnFile [2]int RookOnQueenFile int TrappedRook int KingDefenders [12]int KingShelter [2][8][8]int KingStorm [2][8][8]int KingOnPawnlessFlank int Hanging int ThreatByKing int ThreatByMinor [King + 1]int ThreatByRook [King + 1]int RookBishopExistence [16]int QueenBishopExistence [16]int KingBishopExistence [16]int // // King safety // KingSafetyAttacksWeights [2][Queen + 1]int KingSafetyWeakSquares [2]int KingSafetyFriendlyPawns [2]int KingSafetyNoEnemyQueens [2]int KingSafetySafeQueenCheck [2]int KingSafetySafeRookCheck [2]int KingSafetySafeBishopCheck [2]int KingSafetySafeKnightCheck [2]int KingSafetyAdjustment [2]int // KingSafetyAttackValue is represented as a fraction KingSafetyAttackValueNumerator [2]int KingSafetyAttackValueDenumerator [2]int // // Complexity // ComplexityTotalPawns int ComplexityPawnEndgame int ComplexityPawnBothFlanks int ComplexityInfiltration int ComplexityAdjustment int // // Metadata // BeforeComplexity Score Complexity Score Scale int }
var T Trace
Click to show internal directories.
Click to hide internal directories.