diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/main.rs b/src/main.rs index 822f773..e0d9912 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,22 +1,10 @@ -use std::fmt; - -struct Bitboard(u64); - -impl fmt::Display for Bitboard { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - for index in (0..64) { - f.write_str(if (&self.0 >> index & 1 == 1) { "1" } else { "." }); - if ((index + 1) % 8 == 0) { - f.write_str("\n"); - } - } - return write!(f, "\n") - } -} +mod bitboard; +use bitboard::*; fn main() { - const bb:Bitboard = Bitboard(33); + const bb: Bitboard = Bitboard(127); println!("Hello, world!"); println!("{}", bb); println!("{}", bb.0); + println!("{}", bb.pop_count()); } |