中国象棋规则与搜索本地候选
///|
test "UCCI ready position go quit session" {
let e = @xiangqi.Engine::new()
assert_true(e.command("ucci").has_suffix("ucciok"))
assert_eq(e.command("isready"), "readyok")
assert_eq(e.command("position startpos moves h2e2"), "")
assert_true(e.command("go depth 1").has_prefix("bestmove "))
assert_true(
try {
ignore(e.command("position startpos moves a0a9"))
false
} catch {
_ => true
},
)
assert_eq(e.command("quit"), "")
assert_true(
try {
ignore(e.command("isready"))
false
} catch {
_ => true
},
)
}fn Board::search(self : Board, depth : Int, node_limit? : Int, should_stop? : () -> Bool, on_iteration? : (SearchResult) -> Unit, history? : Array[String]) -> SearchResult raise ChessErrorfn Engine::search(self : Engine, depth : Int, node_limit? : Int, should_stop? : () -> Bool, on_iteration? : (SearchResult) -> Unit) -> SearchResult raise ChessErrorfn Game::search(self : Game, depth : Int, node_limit? : Int, should_stop? : () -> Bool, on_iteration? : (SearchResult) -> Unit) -> SearchResult raise ChessErrorInstall
Download zip中国象棋规则与搜索本地候选