introduced basic position evaluation based on material
This commit is contained in:
1 parent
28d8b2689f
commit
f7286d37a4
3 files changed
+33
-3
No files matched your search
@@ -0,0 +1,16 @@
|
||||
#include "evaluate.h"
|
||||
|
||||
int Evaluate(Board &board) {
|
||||
int score = 0;
|
||||
|
||||
for (int color = White; color <= Black; color++) {
|
||||
for (int type = Pawn; type <= King; type++) {
|
||||
int side = color ? -1 : 1;
|
||||
|
||||
score += (board.pieces[type] & board.colors[color]).PopCount()
|
||||
* materialValues[type] * side;
|
||||
}
|
||||
}
|
||||
|
||||
return score;
|
||||
}
|
||||
Reference in new issue
Block a user