[−][src]Module open_ttt_lib::ai
Provides functionality for creating single player games.
Examples
use open_ttt_lib::ai; use open_ttt_lib::game; let game = game::Game::new(); let ai_opponent = ai::Opponent::new(0.0); match ai_opponent.get_move(&game) { Some(position) => assert!(game.can_move(position)), None => panic!("The game is over so the AI opponent cannot do a move."), };
Structs
Opponent | Provides a computer controlled AI opponent. |
Enums
Outcome | Represents a game outcome for the AI opponent. |
Functions
best_position | Picks a position with the best outcome based on the provided mapping of positions to outcomes. |