aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/moves.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/moves.rs b/src/moves.rs
index 0dd5353..97032e5 100644
--- a/src/moves.rs
+++ b/src/moves.rs
@@ -1,13 +1,19 @@
-use crate::board::Square;
+use crate::{board::Square, bitboard::print};
#[derive(Debug)]
pub struct Move {
- from: Square,
- to: Square,
+ pub from: u8,
+ pub to: u8,
}
-// TODO: think about the size
-type MoveList = [Move; 1024];
+impl Move {
+ pub fn print(&self) {
+ let bb = 1u64 << self.from | 1u64 << self.to;
+ print(bb, format!("{:?}", self).as_str());
+ }
+}
+
+
#[cfg(test)]
mod tests {
@@ -15,7 +21,7 @@ mod tests {
#[test]
fn mock() {
- let mov = Move { from: Square::E2, to: Square::E4 };
+ let mov = Move { from: Square::E2 as u8, to: Square::E4 as u8 };
println!("{:?}", mov);
}
}