From 973a8bf7a63cd185980fb7997da2ea8488c0070e Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 23 Jan 2023 03:41:07 +0300 Subject: fix: correct RANK_6 constant --- src/attacks.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/attacks.rs') diff --git a/src/attacks.rs b/src/attacks.rs index d5bc8a3..7fc6b7d 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 = 0x0000FF0000000000; +static RANK_6: Bitboard = 0x00FF800000000000; /// An array where N-th item is an attack bitboard /// of a piece on N-th square @@ -274,7 +274,7 @@ impl Attacks { ((rank_attacks as u128 * DIAG_A1_H8 as u128) as Bitboard & H_FILE) >> (7 - file) } - fn bishop(&self, occupancy: Bitboard, square: u8) -> Bitboard { + pub fn bishop(&self, occupancy: Bitboard, square: u8) -> Bitboard { let diagonal_mask = self.ray_attacks[Direction::NoEa as usize][square as usize] | self.ray_attacks[Direction::SoWe as usize][square as usize]; @@ -285,7 +285,7 @@ impl Attacks { self.kindergarten_attacks_base(occupancy, diagonal_mask, square) | self.kindergarten_attacks_base(occupancy, anti_diagonal_mask, square) } - fn rook(&self, occupancy: Bitboard, square: u8) -> Bitboard { + pub fn rook(&self, occupancy: Bitboard, square: u8) -> Bitboard { let vertical = self.ray_attacks[Direction::Nort as usize][square as usize] | self.ray_attacks[Direction::Sout as usize][square as usize]; @@ -296,7 +296,7 @@ impl Attacks { self.kindergarten_attacks_file(occupancy, vertical, square) | self.kindergarten_attacks_base(occupancy, horizontal, square) } - fn queen(&self, occupancy: Bitboard, square: u8) -> Bitboard { + pub fn queen(&self, occupancy: Bitboard, square: u8) -> Bitboard { self.rook(occupancy, square) | self.bishop(occupancy, square) } } -- cgit v1.2.3