Combo changes

- move eval_material to eval-simple.c
- move phase_t to eval.h
- init.c: add eval init
- piece.h: add  piece_midval/piece_endval
- fen.c: add phase calculation
- eval-simple: fix calc_phase
This commit is contained in:
2024-07-22 18:16:14 +02:00
parent a4c413bea3
commit 98c54553d0
10 changed files with 98 additions and 69 deletions

View File

@@ -18,8 +18,17 @@
#include "chessdefs.h"
/* game phases
*/
enum {
MIDGAME,
ENDGAME,
PHASE_NB
};
typedef s16 phase_t;
/* max pieces eval is 9*QUEEN_VALUE + 2*ROOK_VALUE + 2*BISHOP_VALUE
* + 2*KNIGHT_VALUE which is (for a pawn valued at 100) well less than 10,000.
* + 2*KNIGHT_VALUE which is (for a pawn valued at 100) well less than 15,000.
*/
#define EVAL_MAX (SHRT_MAX) /* 32767 */
#define EVAL_MIN (-EVAL_MAX)
@@ -28,7 +37,6 @@
#define EVAL_MATE 30000
eval_t eval_material(pos_t *pos, bool color);
eval_t eval_mobility(pos_t *pos, bool color);
eval_t eval_square_control(pos_t *pos, bool color);