aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 3e8e461562282592d5c81f247ebe0b9b7a13ac08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use std::{f32::INFINITY, time::{Duration, Instant}};

use chessnost::board::Board;

fn main() {
    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());
    }
}