aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 822f77398f42a571012c3b855c02b85f82d2fdcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
}