ai-tictactoe 0.1.0

A small, exact tic-tac-toe engine with perfect play
Documentation

ai-tictactoe

A tic-tac-toe rules and search library with perfect play.

Use it

Add the crate to your project:

[dependencies]
ai-tictactoe = "0.1"

Build the tablebase once, then use it for each position:

use ai_tictactoe::{Algorithm, Position, Tablebase, search};

let position = Position::default();
let tablebase = Tablebase::build();
let result = search(position, Algorithm::Tablebase, &tablebase);

assert!(result.best_move.is_some());

The crate also includes negamax, memoized search, symmetry reduction, and a small line-oriented engine.

cargo test
cargo run

Licensed under the MIT License.