From e6102cda73e854b3050cceb86b9f66bac0b81345 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 23 Jan 2023 12:44:14 +0300 Subject: fix: correct RANK_7 constant --- src/attacks.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/attacks.rs') diff --git a/src/attacks.rs b/src/attacks.rs index 6762bb3..2c8e55f 100644 --- a/src/attacks.rs +++ b/src/attacks.rs @@ -9,7 +9,7 @@ static H_FILE: Bitboard = 0x8080808080808080; static DIAG_C2_H7: Bitboard = 0x0080402010080400; static DIAG_A1_H8: Bitboard = 0x8040201008040201; static RANK_2: Bitboard = 0x000000000000FF00; -static RANK_6: Bitboard = 0x00FF800000000000; +static RANK_7: Bitboard = 0x00FF000000000000; /// An array where N-th item is an attack bitboard /// of a piece on N-th square @@ -93,7 +93,7 @@ impl Attacks { double_pushes[Color::White as usize][index] = ((square & RANK_2) << 16); pushes [Color::Black as usize][index] = (square >> 8); - double_pushes[Color::Black as usize][index] = ((square & RANK_6) >> 16); + double_pushes[Color::Black as usize][index] = ((square & RANK_7) >> 16); } (pushes, double_pushes) } @@ -348,7 +348,7 @@ mod tests { assert_eq!(double_pushes[Color::White as usize][Square::E4 as usize], 0); assert_eq!(double_pushes[Color::White as usize][Square::A2 as usize], Square::A4.to_bitboard()); assert_eq!(double_pushes[Color::Black as usize][Square::E4 as usize], 0); - assert_eq!(double_pushes[Color::Black as usize][Square::H6 as usize], Square::H4.to_bitboard()); + assert_eq!(double_pushes[Color::Black as usize][Square::H7 as usize], Square::H5.to_bitboard()); } #[test] -- cgit v1.2.3