Crates.io | blunders-engine |
lib.rs | blunders-engine |
version | 0.1.0 |
source | src |
created_at | 2021-09-22 03:04:05.41681 |
updated_at | 2021-09-22 03:04:05.41681 |
description | UCI chess engine core |
homepage | https://github.com/paulolemus/blunders |
repository | https://github.com/paulolemus/blunders |
max_upload_size | |
id | 454700 |
size | 420,463 |
Blunders Engine is the core library of the Blunders Chess Engine application.
Blunders Engine can either be used by composing the raw components manually, or using the Engine
API.
Search the start position to a depth of 4-ply using a Transposition Table with 10 megabytes of capacity:
use blunders_engine::{search, Position, TranspositionTable};
let tt = TranspositionTable::with_mb(10);
let position = Position::start_position();
let ply = 4;
let search_results = search::search(position, ply, &tt);
println!("best move: {}, nodes/sec: {}", search_results.best_move, search_results.nps());
assert_eq!(search_results.depth, ply);
Do the same as above with the engine API:
use blunders_engine::{EngineBuilder, Position, Mode};
let ply = 4;
let mut engine = EngineBuilder::new()
.position(Position::start_position())
.transpositions_mb(10)
.build();
let search_results = engine.search_sync(Mode::depth(ply, None));
println!("best move: {}, nodes/sec: {}", search_results.best_move, search_results.nps());
assert_eq!(search_results.depth, ply);