[][src]Struct shakmaty_syzygy::Dtz

pub struct Dtz(pub i32);

Distance to zeroing of the half-move clock.

Zeroing the half-move clock while keeping the game theoretical result in hand guarantees making progress.

Can be off by one: Dtz(-n) can mean a loss in n + 1 plies and Dtz(n) can mean a win in n + 1 plies. This is guaranteed not to happen for positions exactly on the edge of the 50-move rule, so that (with some care) this never impacts results of practical play.

DTZWDL
-100 <= n <= -1LossUnconditional loss (assuming the 50-move counter is zero). Zeroing move can be forced in -n plies.
n < -100Blessed lossLoss, but draw under the 50-move rule. A zeroing move can be forced in -n plies or -n - 100 plies (if a later phase is responsible for the blessing).
0Draw
100 < nCursed winWin, but draw under the 50-move rule. A zeroing move can be forced in n or n - 100 plies (if a later phase is responsible for the curse).
1 <= n <= 100WinUnconditional win (assuming the 50-move counter is zero). Zeroing move can be forced in n plies.

Methods

impl Dtz[src]

pub fn before_zeroing<T: Into<Wdl>>(wdl: T) -> Dtz[src]

Converts wdl to a DTZ, given that the best move is zeroing.

WDLDTZ
Loss-1
Blessed loss-101
Draw0
Cursed win101
Win1

pub fn add_plies(self, plies: i32) -> Dtz[src]

Increases the absolute value by plies.

Trait Implementations

impl From<Dtz> for i32[src]

impl From<Dtz> for i64[src]

impl From<Dtz> for i128[src]

impl From<u8> for Dtz[src]

impl From<i8> for Dtz[src]

impl From<u16> for Dtz[src]

impl From<i16> for Dtz[src]

impl From<i32> for Dtz[src]

impl Ord for Dtz[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl PartialOrd<Dtz> for Dtz[src]

impl PartialEq<Dtz> for Dtz[src]

impl Clone for Dtz[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Eq for Dtz[src]

impl Copy for Dtz[src]

impl Debug for Dtz[src]

impl Add<Dtz> for Dtz[src]

type Output = Dtz

The resulting type after applying the + operator.

impl Sub<Dtz> for Dtz[src]

type Output = Dtz

The resulting type after applying the - operator.

impl Neg for Dtz[src]

type Output = Dtz

The resulting type after applying the - operator.

impl AddAssign<Dtz> for Dtz[src]

impl SubAssign<Dtz> for Dtz[src]

Auto Trait Implementations

impl Unpin for Dtz

impl Send for Dtz

impl Sync for Dtz

impl UnwindSafe for Dtz

impl RefUnwindSafe for Dtz

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]