This commit is contained in:
2025-11-03 20:19:05 -08:00
parent eb084e1f07
commit 9b1b6b486d
4 changed files with 9 additions and 32 deletions

View File

@@ -42,28 +42,6 @@ fn step_max(board) {
const AGENTS = {
// special-cased below
Self: undefined,
Random: `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) {
return random_action(board);
}
fn step_max(board) {
return random_action(board);
}`,
};
export default function Playground() {
@@ -126,10 +104,7 @@ export default function Playground() {
// Combine hardcoded agents with saved scripts, ensuring Self and Random are first
const combinedAgents = [
"Self",
"Random",
...Object.keys(AGENTS).filter(
(key) => key !== "Self" && key !== "Random"
),
...Object.keys(AGENTS).filter((key) => key !== "Self"),
...scripts,
];