Add new script and scripts folder

This commit is contained in:
stefiosif
2024-08-04 15:54:43 +03:00
parent 688a401a3d
commit 1988a7e309
4 changed files with 17 additions and 7 deletions

View File

@@ -1,3 +0,0 @@
#!/bin/bash
./target/release/ippos perft

5
scripts/run_perft.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
cargo build --release
./target/release/ippos perft

5
scripts/run_uci.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
cargo build --release
./target/release/ippos uci

View File

@@ -15,8 +15,11 @@ pub mod uci;
fn main() {
attack::init_attacks();
let args: Vec<String> = std::env::args().collect();
if args.len() == 2 && args[1] == "perft" {
perft::perftree_script()
}
let command = std::env::args().nth(1).unwrap_or(String::from("quit"));
match command.as_str() {
"perft" => perft::perftree_script(),
"uci" => uci::uci_loop().unwrap_or_else(|e| println!("{}", e)),
"quit" => println!("Exiting.."),
_ => println!("Wrong command. Exiting.."),
};
}