less broken

This commit is contained in:
nora 2022-01-28 22:51:27 +01:00
parent 00c5fd3754
commit 36128c22c8
2 changed files with 3 additions and 5 deletions

View file

@ -6,5 +6,5 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
bumpalo = { version = "3.9.1", features = ["collections"] } bumpalo = { version = "3.9.1", features = [] }
rand = "0.8.4" rand = "0.8.4"

View file

@ -62,16 +62,14 @@ mod mcts {
} }
} }
const MAX_TRIES: u64 = 5; const MAX_TRIES: u64 = 10_000;
pub fn find_next_move<S: GameState>(current_state: S, opponent: S::Player) -> S { pub fn find_next_move<S: GameState>(current_state: S, opponent: S::Player) -> S {
let alloc = Bump::new(); let alloc = Bump::new();
let root_node = alloc.alloc(Node::new(current_state, &alloc)); let root_node = alloc.alloc(Node::new(current_state, &alloc));
for i in 0..MAX_TRIES { for _ in 0..MAX_TRIES {
dbg!(i);
let promising_node = select_promising_node(root_node); let promising_node = select_promising_node(root_node);
if promising_node.state.status() == Status::InProgress { if promising_node.state.status() == Status::InProgress {