aboutsummaryrefslogtreecommitdiff
path: root/src/moves.rs
blob: 97032e57db7ffcb27bdb5a32b2aebbb7adc1b710 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use crate::{board::Square, bitboard::print};

#[derive(Debug)]
pub struct Move {
    pub from: u8,
    pub to: u8,
}

impl Move {
    pub fn print(&self) {
        let bb = 1u64 << self.from | 1u64 << self.to;
        print(bb, format!("{:?}", self).as_str());
    }
}



#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn mock() {
        let mov = Move { from: Square::E2 as u8, to: Square::E4 as u8 };
        println!("{:?}", mov);
    }
}