Agent library

This commit is contained in:
2025-11-03 16:46:33 -08:00
parent 0db5b7a8f1
commit 684ae0ecf8
2 changed files with 190 additions and 0 deletions

21
agents/random.rhai Normal file
View File

@@ -0,0 +1,21 @@
fn random_action(board) {
let symb = rand_symb();
let pos = rand_int(0, 10);
let action = Action(symb, pos);
while !board.can_play(action) {
let symb = rand_symb();
let pos = rand_int(0, 10);
action = Action(symb, pos);
}
return action
}
fn step_min(board) {
random_action(board)
}
fn step_max(board) {
random_action(board)
}