Rename fn names for better readability

This commit is contained in:
stefiosif
2024-10-06 11:15:29 +03:00
parent 28409d203a
commit 3fd3b1ea96
12 changed files with 102 additions and 121 deletions

View File

@@ -13,7 +13,7 @@ const MVV_LVA: [[usize; 6]; 6] = [
];
pub const fn score_by_mvv_lva(mailbox: &Mailbox, mv: Move) -> usize {
match (mailbox.find_piece_at(mv.src), mailbox.find_piece_at(mv.dst)) {
match (mailbox.piece_at(mv.src), mailbox.piece_at(mv.dst)) {
(Some(aggressor), Some(victim)) => MVV_LVA[aggressor.idx()][victim.idx()],
_ => 0,
}
@@ -32,7 +32,7 @@ mod tests {
#[test]
fn test_score_by_mvv_lva() -> Result<(), String> {
let game = from_fen(FEN)?;
let f3f5 = Move::new_with_type(Square::F3, Square::F5, MoveType::Capture);
let f3f5 = Move::with_type(Square::F3, Square::F5, MoveType::Capture);
let actual = score_by_mvv_lva(&game.mailbox, f3f5);
let expected = MVV_LVA[PieceType::Queen.idx()][PieceType::Pawn.idx()];