Rename fn names for better readability
This commit is contained in:
@@ -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()];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user