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") } } fn main() { const bb:Bitboard = Bitboard(33); println!("Hello, world!"); println!("{}", bb); println!("{}", bb.0); }