summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2022-08-31 05:18:45 +0300
committereug-vs <eugene@eug-vs.xyz>2022-08-31 05:19:13 +0300
commit03371b847296bb4ba70a4cc048a7abd8f0930c9b (patch)
tree96fcb0dcc7b936e88ef9e373c208cbdc88944f7b
parent64a1d2a38bdb6c0b7361af05f955ea55eafffbb3 (diff)
downloadc-chess-03371b847296bb4ba70a4cc048a7abd8f0930c9b.tar.gz
fix: correct pawn evaluation
-rw-r--r--src/main.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index b78d207..2e29417 100644
--- a/src/main.c
+++ b/src/main.c
@@ -348,8 +348,6 @@ int evaluate_pawn(int piece, int rank) {
int color = piece % 2;
if (color == 0) {
switch (rank) {
- case 7:
- return 9;
case 6:
return 5;
case 5:
@@ -359,8 +357,6 @@ int evaluate_pawn(int piece, int rank) {
}
} else {
switch (rank) {
- case 0:
- return 9;
case 1:
return 5;
case 2:
@@ -387,7 +383,7 @@ int compute_material_advantage(int* board, int color) {
counter += INFINITY * sign;
break;
case PAWN:
- counter += evaluate_pawn(piece, rank) * sign;
+ counter += 10 * evaluate_pawn(piece, rank) * sign;
break;
case KNIGHT:
counter += 30 * sign;