summaryrefslogtreecommitdiff
path: root/cli/src/main.rs
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2023-09-27 09:35:50 -0400
committerMicha White <botahamec@outlook.com>2023-09-27 09:35:50 -0400
commit1b379403ab971e188483df5d580c39695db7f44a (patch)
treef9d547fe9d4bf0fd7c8ddabcf5e6fd119a9ff6bf /cli/src/main.rs
parent10438fa9ae1dc4624ebb1780238d46d4b5d3f0eb (diff)
Big changes
Diffstat (limited to 'cli/src/main.rs')
-rw-r--r--cli/src/main.rs86
1 files changed, 0 insertions, 86 deletions
diff --git a/cli/src/main.rs b/cli/src/main.rs
deleted file mode 100644
index d230398..0000000
--- a/cli/src/main.rs
+++ /dev/null
@@ -1,86 +0,0 @@
-use ai::CheckersBitBoard;
-use clap::{App, Arg, SubCommand};
-
-mod eval;
-mod perft;
-
-fn main() {
- let matches = App::new("Ampere")
- .version("0.1")
- .author("Botahamec <botahamec@outlook.com>")
- .about("An American Checkers AI")
- .subcommand(
- SubCommand::with_name("perft")
- .about("Calculate the number of possible moves")
- .arg(
- Arg::with_name("depth")
- .required(true)
- .short("d")
- .takes_value(true)
- .help("The depth to go to"),
- ),
- )
- .subcommand(
- SubCommand::with_name("eval")
- .about("Calculate the advantage")
- .arg(
- Arg::with_name("depth")
- .required(true)
- .short("d")
- .takes_value(true)
- .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") {
- println!(
- "{}",
- perft::positions(
- CheckersBitBoard::starting_position(),
- matches
- .value_of("depth")
- .unwrap()
- .parse::<usize>()
- .expect("Error: not a valid number")
- )
- );
- }
-
- if let Some(matches) = matches.subcommand_matches("eval") {
- println!(
- "{}",
- eval::eval(
- matches
- .value_of("depth")
- .unwrap()
- .parse::<usize>()
- .expect("Error: not a valid number")
- )
- );
- }
-
- if let Some(matches) = matches.subcommand_matches("best") {
- println!(
- "{}",
- eval::best_move(
- matches
- .value_of("depth")
- .unwrap()
- .parse()
- .expect("Error: not a valid number")
- )
- )
- }
-}