aboutsummaryrefslogtreecommitdiff
path: root/benches/search.rs
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2023-02-21 17:49:51 +0300
committereug-vs <eugene@eug-vs.xyz>2023-02-23 14:01:03 +0300
commitf60c573ba71207c18a28413e3940a4e21b07c73f (patch)
tree3e50e9ea6cd0129414db92cd50805ebeb65a4676 /benches/search.rs
parent69f3c48fb99d96f3fbc4ab49f5fb6d1d8e90e270 (diff)
downloadchessnost-f60c573ba71207c18a28413e3940a4e21b07c73f.tar.gz
refactor: create grossmeister module
Diffstat (limited to 'benches/search.rs')
-rw-r--r--benches/search.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/benches/search.rs b/benches/search.rs
index 797638e..2f482ce 100644
--- a/benches/search.rs
+++ b/benches/search.rs
@@ -1,20 +1,21 @@
use std::{time::{Instant, Duration}, f32::INFINITY};
-use chessnost::board::Board;
+use chessnost::{board::{Board, io::IO}, grossmeister::Grossmeister};
fn main() {
let fen = String::from("r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - ");
- let mut board = Board::from_FEN(fen);
+ let board = Board::from_FEN(fen);
+ let mut gm = Grossmeister::new(board);
let start = Instant::now();
- let (score, pv) = board.iterative_deepening(6, Duration::from_secs(15), true);
+ let (score, pv) = gm.iterative_deepening(6, Duration::from_secs(15), true);
println!("Finished in {:?}: score={:?} {:?}", start.elapsed(), score, pv);
- board.print();
+ gm.board.print();
for mov in pv {
- println!("Score for {:?} is now: {}", board.color(), board.quiscence(-INFINITY, INFINITY));
+ println!("Score for {:?} is now: {}", gm.board.color(), gm.quiscence(-INFINITY, INFINITY));
println!("{:?}", mov);
- board.make_move(mov);
- board.print();
+ gm.board.make_move(mov);
+ gm.board.print();
}
- println!("Score for {:?} is now: {}", board.color(), board.quiscence(-INFINITY, INFINITY));
+ println!("Score for {:?} is now: {}", gm.board.color(), gm.quiscence(-INFINITY, INFINITY));
}