aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2023-01-23 12:44:14 +0300
committereug-vs <eugene@eug-vs.xyz>2023-01-23 12:44:14 +0300
commite6102cda73e854b3050cceb86b9f66bac0b81345 (patch)
tree8d9cb9a6c59e45882047c45a2b784d0b35fe7f72
parent7db4fb8f8019449570ea85379b938617353ca8bb (diff)
downloadchessnost-e6102cda73e854b3050cceb86b9f66bac0b81345.tar.gz
fix: correct RANK_7 constant
-rw-r--r--src/attacks.rs6
1 files changed, 3 insertions, 3 deletions
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]