diff options
Diffstat (limited to 'engine/src/main.rs')
| -rw-r--r-- | engine/src/main.rs | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/engine/src/main.rs b/engine/src/main.rs index afc132f..3b41418 100644 --- a/engine/src/main.rs +++ b/engine/src/main.rs @@ -1,13 +1,38 @@ -use engine::{CheckersBitBoard, TranspositionTable}; +use std::{num::NonZeroU8, thread::sleep, time::Duration}; + +use engine::{ActualLimit, Engine, EvaluationSettings, Frontend}; use mimalloc::MiMalloc; #[global_allocator] static ALLOCATOR: MiMalloc = MiMalloc; -const DEPTH: u8 = 18; +const DEPTH: u8 = 19; + +struct BasicFrontend; + +impl Frontend for BasicFrontend { + fn debug(&self, msg: &str) {} + + fn report_best_move(&self, best_move: model::Move) { + println!("{best_move}"); + std::process::exit(0); + } +} fn main() { - //let board = CheckersBitBoard::starting_position(); - //let mut table = TranspositionTable::new(50_000); - //println!("{}", current_evaluation(DEPTH, board, table.get_ref())); + let engine = Box::leak(Box::new(Engine::new(1_000_000, &BasicFrontend))); + engine.start_evaluation(EvaluationSettings { + restrict_moves: None, + ponder: false, + clock: engine::Clock::Unlimited, + search_until: engine::SearchLimit::Limited(ActualLimit { + nodes: None, + depth: Some(NonZeroU8::new(DEPTH).unwrap()), + time: None, + }), + }); + + loop { + sleep(Duration::from_millis(200)) + } } |
