fdsnhkjfsdjkoilklhj;fvjlki;fdg

minimax-pkg
Drake 1 year ago
parent 607fc63f4f
commit f35413d395

@ -19,6 +19,7 @@ use crate::config::DEFAULT_DEPTH;
struct Options { struct Options {
pub en_passant: bool, pub en_passant: bool,
pub depth: i64, pub depth: i64,
pub debug: bool,
} }
fn main() { fn main() {
@ -27,10 +28,12 @@ fn main() {
let mut options: Options = Options { let mut options: Options = Options {
en_passant: false, en_passant: false,
depth: DEFAULT_DEPTH.into(), depth: DEFAULT_DEPTH.into(),
debug: false,
}; };
for line in io::stdin().lock().lines() { for line in io::stdin().lock().lines() {
let msg: UciMessage = parse_one(&line.unwrap()); let line = line.unwrap();
let msg: UciMessage = parse_one(&line);
match msg { match msg {
UciMessage::Uci => { UciMessage::Uci => {
println!( println!(
@ -65,6 +68,7 @@ fn main() {
} }
_ => unimplemented!(), _ => unimplemented!(),
}, },
UciMessage::Debug(debug) => options.debug = debug,
UciMessage::IsReady => { UciMessage::IsReady => {
println!("{}", UciMessage::ReadyOk) println!("{}", UciMessage::ReadyOk)
} }
@ -157,5 +161,8 @@ fn main() {
todo!("{}", msg.to_string()) todo!("{}", msg.to_string())
} }
} }
if options.debug {
println!("{}\n", UciMessage::info_string(line))
}
} }
} }

Loading…
Cancel
Save