20 个版本
0.0.20 | 2023 年 12 月 13 日 |
---|---|
0.0.19 | 2023 年 12 月 12 日 |
0.0.8 | 2023 年 3 月 29 日 |
#153 in 游戏
每月 154 次下载
16KB
298 行
monster-ugi
概览
monster-ugi
是一个使用 Rust 编写的 fairy 棋引擎包装器,用于使用 monster-chess
移动生成库编写的引擎。它允许您轻松地为您的引擎公开 API,并将其连接到 UCI、UAI 或 UGI 协议之一。它主要针对您的引擎与 cutegames 兼容。Cutegames 使用 UGI 协议,它是现有的 UCI 和 UAI 协议的超集。要使用它,实现 EngineBehavior
特性
impl<const T: usize> EngineBehavior<T> for RandomEngine<T> {
fn select_move(&mut self, board: &mut Board<T>, time_control: TimeControl) -> MoveSelectionResults {
let best_move = *board.generate_legal_moves(0).choose(&mut self.0).expect("Could not find a move to pick between for random movegen.");
MoveSelectionResults {
best_move,
evaluation: 0
}
}
fn get_engine_info(&mut self) -> EngineInfo {
EngineInfo {
name: "Random",
author: "Corman"
}
}
fn is_ready(&mut self) -> bool {
true
}
fn stop_search(&mut self) {}
}
然后创建引擎实例
let engine = Engine {
behavior: RandomEngine::new(thread_rng()),
game: Chess::create()
}
并运行 UGI。
run_ugi(engine);
许可证
依赖项
~1MB
~20K SLoC