Module board_game::util::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
- Iterator over randomly generated boards. Yields all intermediate boards, including the start and end of each simulation.
Functions
- Play the given moves, starting from
start
. - Generate a
Board
by playing random moves untilcond(&board)
returns true. - Generate a random board such that
cond(board, depth) & !cond(board, depth-1)
. - 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. - Generate a
Board
by playing random moves until a forced win indepth
moves is found forboard.next_player
, which may be different fromstart.next_player
. - Generate a
Board
by playing random moves until a forced win indepth
moves is found forplayer
. - Generate a
Board
by playingn
random moves onstart
. - Generate a random
Board
with a specificOutcome
.