diff options
Diffstat (limited to 'cli/src/main.rs')
| -rw-r--r-- | cli/src/main.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cli/src/main.rs b/cli/src/main.rs index a550092..d230398 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -31,6 +31,17 @@ fn main() { .help("The depth to go to"), ), ) + .subcommand( + SubCommand::with_name("best") + .about("Calculate the best move") + .arg( + Arg::with_name("depth") + .required(true) + .short("d") + .takes_value(true) + .help("The depth to go to"), + ), + ) .get_matches(); if let Some(matches) = matches.subcommand_matches("perft") { @@ -59,4 +70,17 @@ fn main() { ) ); } + + if let Some(matches) = matches.subcommand_matches("best") { + println!( + "{}", + eval::best_move( + matches + .value_of("depth") + .unwrap() + .parse() + .expect("Error: not a valid number") + ) + ) + } } |
