Skip to main content

demo2/
demo2.rs

1use stockfish::Stockfish;
2use std::time::Duration;
3
4fn main() -> Result<(), std::io::Error> {
5    let path = if cfg!(target_os = "windows") {
6        "./stockfish.exe"
7    } else {
8        "stockfish"
9    };
10
11    let mut stockfish = Stockfish::new(&path)?;
12    stockfish.setup_for_new_game()?;
13    stockfish.print_board()?;
14
15    let engine_output = stockfish.go_for(Duration::from_millis(5000))?;
16    println!("engine_output: {engine_output:?}");
17
18    Ok(())
19}