aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2023-01-28 06:32:57 +0300
committereug-vs <eugene@eug-vs.xyz>2023-01-28 06:32:57 +0300
commit674247fb2211392653ba92171cd53f3e556e2882 (patch)
tree6c0f473e1cc95c4a6cbd26eb53dde35f0e8adab6 /src
parenta7b6e6e687c327b8cd86350240a3b2c395b47af1 (diff)
downloadchessnost-674247fb2211392653ba92171cd53f3e556e2882.tar.gz
feat: basic pondering
Diffstat (limited to 'src')
-rw-r--r--src/main.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index cc087b6..6a374b7 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,10 +1,9 @@
use std::{f32::INFINITY, time::{Duration, Instant}};
-use chessnost::board::{Board, Color};
+use chessnost::board::Board;
fn main() {
- let fen = String::from("5k2/p2Q4/2p5/4q3/8/2P2Pp1/PP4P1/1K3N2 w - - 1 29");
- let mut board = Board::from_FEN(fen);
+ let mut board = Board::new();
board.print();
@@ -21,7 +20,7 @@ fn main() {
board.print();
let start = Instant::now();
- let (score, pv) = board.iterative_deepening(10, Duration::from_secs(10));
+ let (score, pv) = board.iterative_deepening(10, Duration::from_secs(7));
println!("Finished in {:?}: score={:?}", start.elapsed(), score);
let mov = pv[0];
@@ -29,5 +28,8 @@ fn main() {
board.make_move(mov);
board.print();
println!("Score for {:?} is now: {}", board.color(), board.quiscence(-INFINITY, INFINITY));
+
+ // Simple pondering during opponent time
+ board.iterative_deepening(5, Duration::from_secs(3));
}
}