aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/attacks.rs4
-rw-r--r--src/bitboard.rs1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/attacks.rs b/src/attacks.rs
index 97e4f37..787f200 100644
--- a/src/attacks.rs
+++ b/src/attacks.rs
@@ -236,6 +236,7 @@ mod tests {
assert_eq!(pop_count(attacks[Square::G1 as usize]), 3);
assert_eq!(pop_count(attacks[Square::H8 as usize]), 2);
+ print(attacks[Square::E4 as usize]);
}
#[test]
@@ -252,6 +253,7 @@ mod tests {
assert_eq!(pop_count(attacks[Square::E8 as usize]), 5);
assert_eq!(pop_count(attacks[Square::A4 as usize]), 5);
assert_eq!(pop_count(attacks[Square::H4 as usize]), 5);
+ print(attacks[Square::E4 as usize]);
}
#[test]
@@ -265,14 +267,12 @@ mod tests {
assert_eq!(attacks[0b00010100][4], 0b11101100);
assert_eq!(attacks[0b01010100][4], 0b01101100);
assert_eq!(attacks[0b01010010][4], 0b01101110);
-
}
#[test]
fn test_ray_attacks() {
let attacks = Attacks::precompute_ray_attacks();
let square = Square::E4 as usize;
-
let bitboard =
attacks[0][square] |
attacks[1][square] |
diff --git a/src/bitboard.rs b/src/bitboard.rs
index 646006c..f43d28e 100644
--- a/src/bitboard.rs
+++ b/src/bitboard.rs
@@ -5,6 +5,7 @@ pub type Bitboard = u64;
/// (i.e the board is actually flipped along X)
#[allow(dead_code)]
pub fn print(bb: Bitboard) {
+ println!();
for index in 0..64 {
print!("{}", if bb >> index & 1 == 1 { "1" } else { "." });
if (index + 1) % 8 == 0 {