added positional evaluation
This commit is contained in:
1 parent
f7286d37a4
commit
3507637d8f
3 files changed
+118
-8
No files matched your search
+84
-1
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "board.h"
|
||||
|
||||
constexpr int materialValues[] {
|
||||
constexpr int materialValues[6] {
|
||||
100, // Pawn
|
||||
300, // Knight
|
||||
350, // Bishop
|
||||
@@ -10,4 +10,87 @@ constexpr int materialValues[] {
|
||||
10000 // King
|
||||
};
|
||||
|
||||
constexpr int pieceSquareScores[7][64] {
|
||||
// Pawn
|
||||
{0, 0, 0, 0, 0, 0, 0, 0,
|
||||
50, 50, 50, 50, 50, 50, 50, 50,
|
||||
10, 10, 20, 30, 30, 20, 10, 10,
|
||||
5, 5, 10, 25, 25, 10, 5, 5,
|
||||
0, 0, 0, 20, 20, 0, 0, 0,
|
||||
5, -5,-10, 0, 0,-10, -5, 5,
|
||||
5, 10, 10,-20,-20, 10, 10, 5,
|
||||
0, 0, 0, 0, 0, 0, 0, 0},
|
||||
|
||||
// Knight
|
||||
{-50,-40,-30,-30,-30,-30,-40,-50,
|
||||
-40,-20, 0, 0, 0, 0,-20,-40,
|
||||
-30, 0, 10, 15, 15, 10, 0,-30,
|
||||
-30, 5, 15, 20, 20, 15, 5,-30,
|
||||
-30, 0, 15, 20, 20, 15, 0,-30,
|
||||
-30, 5, 10, 15, 15, 10, 5,-30,
|
||||
-40,-20, 0, 5, 5, 0,-20,-40,
|
||||
-50,-40,-30,-30,-30,-30,-40,-50},
|
||||
|
||||
// Bishop
|
||||
{-20,-10,-10,-10,-10,-10,-10,-20,
|
||||
-10, 0, 0, 0, 0, 0, 0,-10,
|
||||
-10, 0, 5, 10, 10, 5, 0,-10,
|
||||
-10, 5, 5, 10, 10, 5, 5,-10,
|
||||
-10, 0, 10, 10, 10, 10, 0,-10,
|
||||
-10, 10, 10, 10, 10, 10, 10,-10,
|
||||
-10, 5, 0, 0, 0, 0, 5,-10,
|
||||
-20,-10,-10,-10,-10,-10,-10,-20},
|
||||
|
||||
// Rook
|
||||
{0, 0, 0, 0, 0, 0, 0, 0,
|
||||
5, 10, 10, 10, 10, 10, 10, 5,
|
||||
-5, 0, 0, 0, 0, 0, 0, -5,
|
||||
-5, 0, 0, 0, 0, 0, 0, -5,
|
||||
-5, 0, 0, 0, 0, 0, 0, -5,
|
||||
-5, 0, 0, 0, 0, 0, 0, -5,
|
||||
-5, 0, 0, 0, 0, 0, 0, -5,
|
||||
0, 0, 0, 5, 5, 0, 0, 0},
|
||||
|
||||
// Queen
|
||||
{-20,-10,-10, -5, -5,-10,-10,-20,
|
||||
-10, 0, 0, 0, 0, 0, 0,-10,
|
||||
-10, 0, 5, 5, 5, 5, 0,-10,
|
||||
-5, 0, 5, 5, 5, 5, 0, -5,
|
||||
0, 0, 5, 5, 5, 5, 0, -5,
|
||||
-10, 5, 5, 5, 5, 5, 0,-10,
|
||||
-10, 0, 5, 0, 0, 0, 0,-10,
|
||||
-20,-10,-10, -5, -5,-10,-10,-20},
|
||||
|
||||
// King middle game
|
||||
{-30,-40,-40,-50,-50,-40,-40,-30,
|
||||
-30,-40,-40,-50,-50,-40,-40,-30,
|
||||
-30,-40,-40,-50,-50,-40,-40,-30,
|
||||
-30,-40,-40,-50,-50,-40,-40,-30,
|
||||
-20,-30,-30,-40,-40,-30,-30,-20,
|
||||
-10,-20,-20,-20,-20,-20,-20,-10,
|
||||
20, 20, 0, 0, 0, 0, 20, 20,
|
||||
20, 30, 10, 0, 0, 10, 30, 20},
|
||||
|
||||
// King end game
|
||||
{-30,-40,-40,-50,-50,-40,-40,-30,
|
||||
-30,-40,-40,-50,-50,-40,-40,-30,
|
||||
-30,-40,-40,-50,-50,-40,-40,-30,
|
||||
-30,-40,-40,-50,-50,-40,-40,-30,
|
||||
-20,-30,-30,-40,-40,-30,-30,-20,
|
||||
-10,-20,-20,-20,-20,-20,-20,-10,
|
||||
20, 20, 0, 0, 0, 0, 20, 20,
|
||||
20, 30, 10, 0, 0, 10, 30, 20}
|
||||
};
|
||||
|
||||
constexpr int scoreSquares[64] {
|
||||
a8, b8, c8, d8, e8, f8, g8, h8,
|
||||
a7, b7, c7, d7, e7, f7, g7, h7,
|
||||
a6, b6, c6, d6, e6, f6, g6, h6,
|
||||
a5, b5, c5, d5, e5, f5, g5, h5,
|
||||
a4, b4, c4, d4, e4, f4, g4, h4,
|
||||
a3, b3, c3, d3, e3, f3, g3, h3,
|
||||
a2, b2, c2, d2, e2, f2, g2, h2,
|
||||
a1, b1, c1, d1, e1, f1, g1, h1
|
||||
};
|
||||
|
||||
int Evaluate(Board &board);
|
||||
Reference in new issue
Block a user