Reduce size of eval to i16
This commit is contained in:
@@ -5,7 +5,7 @@ pub fn score_move(
|
||||
mv: Move,
|
||||
killer_move: Option<Move>,
|
||||
tt_move: Option<Move>,
|
||||
) -> i32 {
|
||||
) -> i16 {
|
||||
if Some(mv) == tt_move {
|
||||
return -100;
|
||||
}
|
||||
@@ -15,9 +15,11 @@ pub fn score_move(
|
||||
}
|
||||
|
||||
let aggressor = mailbox.piece_at(mv.src()).expect("No aggressor found.");
|
||||
mailbox.piece_at(mv.dst()).map_or(100, |victim| {
|
||||
aggressor.0.idx() as i32 - (victim.0.idx() * 8) as i32
|
||||
})
|
||||
if let Some(victim) = mailbox.piece_at(mv.dst()) {
|
||||
return (aggressor.0.idx() - 8 * victim.0.idx()) as i16;
|
||||
}
|
||||
|
||||
100
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user