Implement PeSTO eval

This commit is contained in:
stefiosif
2025-01-12 23:02:10 +02:00
parent 365bd71a6f
commit 2c9181993f
7 changed files with 279 additions and 270 deletions

View File

@@ -1,6 +1,4 @@
use crate::{
board::mailbox::Mailbox, evaluation::evaluation::material_score, movegen::r#move::Move,
};
use crate::{board::mailbox::Mailbox, movegen::r#move::Move};
pub fn sort_moves(mut moves: Vec<Move>, mailbox: &Mailbox, tt_move: Option<Move>) -> Vec<Move> {
if let Some(tt_move) = tt_move {
@@ -17,7 +15,7 @@ pub fn sort_moves(mut moves: Vec<Move>, mailbox: &Mailbox, tt_move: Option<Move>
const fn mvv_lva(mailbox: &Mailbox, mv: Move) -> i32 {
match (mailbox.piece_at(mv.src), mailbox.piece_at(mv.dst)) {
(Some(aggressor), Some(victim)) => material_score(victim.0) - material_score(aggressor.0),
(Some(aggressor), Some(victim)) => victim.0.score() - aggressor.0.score(),
_ => -1000,
}
}