Skip to content

Commit

Permalink
refactor: updated uci-parser details
Browse files Browse the repository at this point in the history
bench: 8240023
  • Loading branch information
dannyhammer committed Jan 7, 2025
1 parent 0e54ef3 commit ac4239c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ anyhow = "1.0.89"
arrayvec = "0.7.6"
clap = { version = "4.5.18", features = ["derive", "string"] }
thiserror = "2.0.7"
#uci-parser = { path = "../../uci-parser", features = ["parse-go-perft", "parse-position-kiwipete", "clamp-negatives", "err-on-unused-input"] }
#uci-parser = { path = "../uci-parser", features = ["parse-go-perft", "parse-position-kiwipete", "clamp-negatives", "err-on-unused-input"] }
uci-parser = { git = "https://github.com/dannyhammer/uci-parser.git", features = ["parse-go-perft", "parse-position-kiwipete", "clamp-negatives", "err-on-unused-input"] }
#uci-parser = { version = "0.2.0", features = ["parse-go-perft", "parse-position-kiwipete", "clamp-negatives", "err-on-unused-input"] }
#uci-parser = { version = "3.0.0", features = ["parse-go-perft", "parse-position-kiwipete", "clamp-negatives", "err-on-unused-input"] }
10 changes: 5 additions & 5 deletions src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ impl Engine {

Debug(status) => self.debug = status,

IsReady => println!("{}", UciResponse::<&str>::ReadyOk),
IsReady => println!("{}", UciResponse::readyok()),

SetOption { name, value } => self.set_option(&name, value)?,

Expand Down Expand Up @@ -654,15 +654,15 @@ impl Engine {
///
/// Prints engine's ID, version, and authors, and lists all UCI options.
fn uci(&self) {
println!("id name {}\nid author {}\n", self.name(), self.authors());
println!("{}", UciResponse::Name(self.name()));
println!("{}\n", UciResponse::Name(self.authors()));

// Print all UCI options
for opt in self.options() {
println!("{}", UciResponse::Option(opt));
}

// We're ready to go!
println!("{}", UciResponse::<&str>::UciOk)
println!("{}", UciResponse::uciok());
}

/// Convenience function to return an iterator over all UCI options this engine supports.
Expand Down Expand Up @@ -804,7 +804,7 @@ impl Engine {
/// Helper to send a [`UciInfo`] containing only a `string` message to `stdout`.
#[inline(always)]
fn send_string<T: fmt::Display>(info: T) {
let resp = UciResponse::<String>::Info(Box::new(UciInfo::new().string(info)));
let resp = UciResponse::info(UciInfo::new().string(info));
println!("{resp}");
}

Expand Down

0 comments on commit ac4239c

Please sign in to comment.