Struct zero_sum::impls::tic_tac_toe::Board
[−]
[src]
pub struct Board(pub [Option<Mark>; 9], pub u8);
The 3x3 game board.
Methods
impl Board
[src]
fn new() -> Board
Creates an empty board.
fn next_mark(&self) -> Mark
Returns the mark that will make the next move.
Trait Implementations
impl Display for Board
[src]
impl State for Board
[src]
type Ply = Ply
type Resolution = Resolution
fn get_ply_count(&self) -> usize
Returns the number of plies that have passed in the game.
fn execute_ply(&mut self, ply: Option<&Ply>) -> Result<(), String>
Executes the given ply on this state. Pass None
to execute a null move.
fn revert_ply(&mut self, ply: Option<&Ply>) -> Result<(), String>
Reverts the given ply from the state. Pass None
to revert a null move.
fn check_resolution(&self) -> Option<Resolution>
Returns None
if the game has not reached a conclusion.
fn null_move_allowed(&self) -> bool
Returns true if the state is in a good place to allow the null move search optimization. This is optional to implement, returning a default of false
. Read more
fn execute_plies(&mut self, plies: &[Self::Ply]) -> Result<(), String>
Executes each ply in plies
on the result of the previous ply.
impl Extrapolatable<Ply> for Board
[src]
fn extrapolate(&self) -> Vec<Ply>
Returns a list of plies that should be considered from the current state. The search system does not assume that all plies returned are correct. Read more
impl Clone for Board
[src]
fn clone(&self) -> Board
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Board
[src]
impl Eq for Board
[src]
impl PartialEq for Board
[src]
fn eq(&self, __arg_0: &Board) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Board) -> bool
This method tests for !=
.