From 674247fb2211392653ba92171cd53f3e556e2882 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 28 Jan 2023 06:32:57 +0300 Subject: feat: basic pondering --- src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/main.rs') 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)); } } -- cgit v1.2.3