diff options
| author | Micha White <botahamec@outlook.com> | 2023-09-27 09:41:01 -0400 |
|---|---|---|
| committer | Micha White <botahamec@outlook.com> | 2023-09-27 09:41:01 -0400 |
| commit | f7a7bf20a99b1d52ef5f936705611ce24a1006b7 (patch) | |
| tree | 1fd1c71d1e94d664f9f6c74e7610eb94b0c68f49 | |
| parent | 89a1d6b488f83d121e55d8a6c08efe01649bb692 (diff) | |
Edited some of the crates
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | ai/src/main.rs | 25 | ||||
| -rw-r--r-- | engine/.gitignore (renamed from ai/.gitignore) | 0 | ||||
| -rw-r--r-- | engine/Cargo.toml (renamed from ai/Cargo.toml) | 3 | ||||
| -rw-r--r-- | engine/src/eval.rs (renamed from ai/src/eval.rs) | 0 | ||||
| -rw-r--r-- | engine/src/lib.rs (renamed from ai/src/lib.rs) | 0 | ||||
| -rw-r--r-- | engine/src/main.rs | 22 | ||||
| -rw-r--r-- | engine/src/transposition_table.rs (renamed from ai/src/transposition_table.rs) | 0 | ||||
| -rw-r--r-- | model/Cargo.toml | 1 | ||||
| -rw-r--r-- | ui/Cargo.toml | 4 |
10 files changed, 29 insertions, 28 deletions
@@ -1,7 +1,7 @@ [workspace]
resolver = "2"
members = [
- "ai",
+ "engine",
"model",
"pdn",
"ui"
diff --git a/ai/src/main.rs b/ai/src/main.rs deleted file mode 100644 index dcedcb5..0000000 --- a/ai/src/main.rs +++ /dev/null @@ -1,25 +0,0 @@ -use ai::TranspositionTable; - -const DEPTH: u8 = 18; - -fn main() { - let board = ai::CheckersBitBoard::starting_position(); - let mut table = TranspositionTable::new(50_000); - let mut alpha = -1.0; - let mut beta = 1.0; - for i in 0..DEPTH { - let mut eval = ai::negamax(i, alpha, beta, board, table.mut_ref()); - - if (eval <= alpha) || (eval >= beta) { - eval = ai::negamax(i, -1.0, 1.0, board, table.mut_ref()); - } - - alpha = f32::max(eval + 0.125, -1.0); - beta = f32::min(eval + 0.125, 1.0); - } - - println!( - "{:?}", - ai::negamax(DEPTH, alpha, beta, board, table.mut_ref(),) - ); -} diff --git a/ai/.gitignore b/engine/.gitignore index 96ef6c0..96ef6c0 100644 --- a/ai/.gitignore +++ b/engine/.gitignore diff --git a/ai/Cargo.toml b/engine/Cargo.toml index 6a4ea61..87410c5 100644 --- a/ai/Cargo.toml +++ b/engine/Cargo.toml @@ -1,8 +1,9 @@ [package] -name = "ai" +name = "engine" version = "0.1.0" authors = ["botahamec"] edition = "2018" +publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/ai/src/eval.rs b/engine/src/eval.rs index a3265bf..a3265bf 100644 --- a/ai/src/eval.rs +++ b/engine/src/eval.rs diff --git a/ai/src/lib.rs b/engine/src/lib.rs index 06f0818..06f0818 100644 --- a/ai/src/lib.rs +++ b/engine/src/lib.rs diff --git a/engine/src/main.rs b/engine/src/main.rs new file mode 100644 index 0000000..59002ec --- /dev/null +++ b/engine/src/main.rs @@ -0,0 +1,22 @@ +use engine::{negamax, CheckersBitBoard, TranspositionTable}; + +const DEPTH: u8 = 18; + +fn main() { + let board = CheckersBitBoard::starting_position(); + let mut table = TranspositionTable::new(50_000); + let mut alpha = -1.0; + let mut beta = 1.0; + for i in 0..DEPTH { + let mut eval = negamax(i, alpha, beta, board, table.mut_ref()); + + if (eval <= alpha) || (eval >= beta) { + eval = negamax(i, -1.0, 1.0, board, table.mut_ref()); + } + + alpha = f32::max(eval + 0.125, -1.0); + beta = f32::min(eval + 0.125, 1.0); + } + + println!("{:?}", negamax(DEPTH, alpha, beta, board, table.mut_ref(),)); +} diff --git a/ai/src/transposition_table.rs b/engine/src/transposition_table.rs index 2b56a66..2b56a66 100644 --- a/ai/src/transposition_table.rs +++ b/engine/src/transposition_table.rs diff --git a/model/Cargo.toml b/model/Cargo.toml index cdda386..891889a 100644 --- a/model/Cargo.toml +++ b/model/Cargo.toml @@ -3,6 +3,7 @@ name = "model" version = "0.1.0" authors = ["Mike White <botahamec@outlook.com>"] edition = "2018" +publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/ui/Cargo.toml b/ui/Cargo.toml index 086a7de..c4a1e04 100644 --- a/ui/Cargo.toml +++ b/ui/Cargo.toml @@ -2,9 +2,11 @@ name = "ui" version = "0.1.0" edition = "2018" +publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] tetra = "0.6" -model = {path = "../model"}
\ No newline at end of file +model = {path = "../model"} +engine = {path = "../engine"}
\ No newline at end of file |
