diff options
| author | Mike White <botahamec@outlook.com> | 2021-09-15 20:49:13 -0400 |
|---|---|---|
| committer | Mike White <botahamec@outlook.com> | 2021-09-15 20:49:13 -0400 |
| commit | 01b456b4fef8ce4a002f870e5385424614a2a5fb (patch) | |
| tree | 6f44e7d775a7a77d9b0d5dcf13e25b35a25e9737 /cli/src/main.rs | |
| parent | cbdd3f7be61f1040e84b757a5b8404378de3c46c (diff) | |
Added best move function
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") + ) + ) + } } |
