aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index e7a11a9..3e8e461 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,3 +1,19 @@
+use std::{f32::INFINITY, time::{Duration, Instant}};
+
+use chessnost::board::Board;
+
fn main() {
- println!("Hello, world!");
+ let mut board = Board::new();
+
+ loop {
+ let start = Instant::now();
+ let (score, pv) = board.iterative_deepening(Duration::from_secs(4));
+ println!("Finished in {:?}: score={:?}", start.elapsed(), score);
+
+ let mov = pv[0];
+ println!("{:?}", mov);
+ board.make_move(mov);
+ board.print();
+ println!("Score for {:?} is now: {} (material advantage={})", board.color(), board.quiscence(-INFINITY, INFINITY), board.material_advantage());
+ }
}