Module board_gen

Source
Expand description

Utilities to generate a Board in a random state.

Re-exports§

pub use crate::ai::solver::is_double_forced_draw;

Structs§

RandomBoardIterator
Iterator over randomly generated boards. Yields all intermediate boards, including the start and end of each simulation.

Functions§

board_with_moves
Play the given moves, starting from start.
random_board_with_condition
Generate a Board by playing random moves until cond(&board) returns true.
random_board_with_depth_condition
Generate a random board such that cond(board, depth) & !cond(board, depth-1).
random_board_with_double_forced_draw
Generate a random board with a double forced draw in depth moves, meaning that no matter what either player does it’s impossible for someone to win.
random_board_with_forced_win
Generate a Board by playing random moves until a forced win in depth moves is found for board.next_player, which may be different from start.next_player.
random_board_with_forced_win_for
Generate a Board by playing random moves until a forced win in depth moves is found for player.
random_board_with_moves
Generate a Board by playing n random moves on start.
random_board_with_outcome
Generate a random Board with a specific Outcome.