Skip to main content

TreeDisplayFormat

Enum TreeDisplayFormat 

Source
pub enum TreeDisplayFormat {
    Standard,
}
Expand description

Formats of display used by TreeDisplay.

Variants§

§

Standard

The default value.

§Examples

use std::str::FromStr;
use tokyodoves::{BoardBuilder, Color};
use tokyodoves::game::GameRule;
use tokyodoves::analysis::create_checkmate_tree;

let board = BoardBuilder::from_str(" By;H  a;A m;  Yb")?.build()?;
let rule = GameRule::new(true);
let tree = create_checkmate_tree(board, Color::Red, 3, rule)?;
println!("{}", tree.display());

The following is the standard output of above code.

(Board(" By ;H  a;A m ;  Yb"), Red, Win(3))
    +MS1E1 => (Board(" By ;H Ma;A m ;  Yb"), Green, Lose(2))
        bS2E2 => (Board(" By ;H Ma;A mb;  Y "), Red, Win(1))
            YS3E2 => (Board(" By ;H Ma;A mb;   Y"), Red, Finished)
        +hE2 => (Board(" Byh;H Ma;A m ;  Yb"), Red, Win(1))
            MS2E2 => (Board(" Byh;H  a;A mM;  Yb"), Red, Finished)
        -a => (Board(" By ;H M ;A m ;  Yb"), Red, Win(1))
            MS2E2 => (Board(" By ;H   ;A mM;  Yb"), Red, Finished)
        +hS2 => (Board(" By ;H Ma;Ahm ;  Yb"), Red, Win(1))
            MS2E2 => (Board(" By ;H  a;AhmM;  Yb"), Red, Finished)
        yE2 => (Board(" B y;H Ma;A m ;  Yb"), Red, Win(1))
            MS2E2 => (Board(" B y;H  a;A mM;  Yb"), Red, Finished)
        mS1 => (Board(" By ;HmMa;A   ;  Yb"), Red, Win(1))
            MS2E2 => (Board(" By ;Hm a;A  M;  Yb"), Red, Finished)
        +hS3 => (Board(" By ;H Ma;A m ; hYb"), Red, Win(1))
            MS2E2 => (Board(" By ;H  a;A mM; hYb"), Red, Finished)
        -m => (Board(" By ;H Ma;A   ;  Yb"), Red, Win(1))
            MS2E2 => (Board(" By ;H  a;A  M;  Yb"), Red, Finished)
        +tS2 => (Board(" By ;H Ma;Atm ;  Yb"), Red, Win(1))
            MS2E2 => (Board(" By ;H  a;AtmM;  Yb"), Red, Finished)
        +tE2 => (Board(" Byt;H Ma;A m ;  Yb"), Red, Win(1))
            MS2E2 => (Board(" Byt;H  a;A mM;  Yb"), Red, Finished)
        +tS3 => (Board(" By ;H Ma;A m ; tYb"), Red, Win(1))
            MS2E2 => (Board(" By ;H  a;A mM; tYb"), Red, Finished)
        aE2 => (Board(" Bya;H M ;A m ;  Yb"), Red, Win(1))
            MS2E2 => (Board(" Bya;H   ;A mM;  Yb"), Red, Finished)
        mS3 => (Board(" By ;H Ma;A   ; mYb"), Red, Win(1))
            MS2E2 => (Board(" By ;H  a;A  M; mYb"), Red, Finished)
        -y => (Board(" B  ;H Ma;A m ;  Yb"), Red, Win(1))
            MS2E2 => (Board(" B  ;H  a;A mM;  Yb"), Red, Finished)

Trait Implementations§

Source§

impl Clone for TreeDisplayFormat

Source§

fn clone(&self) -> TreeDisplayFormat

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TreeDisplayFormat

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TreeDisplayFormat

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.