Struct shakmaty_syzygy::Dtz
source · pub struct Dtz(pub i32);
Expand description
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.
DTZ | WDL | |
---|---|---|
-100 <= n <= -1 | Loss | Unconditional loss (assuming the 50-move counter is zero). Zeroing move can be forced in -n plies. |
n < -100 | Blessed loss | Loss, 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). |
0 | Draw | |
100 < n | Cursed win | Win, 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 <= 100 | Win | Unconditional win (assuming the 50-move counter is zero). Zeroing move can be forced in n plies. |
Tuple Fields
0: i32
Implementations
Trait Implementations
sourceimpl AddAssign<Dtz> for Dtz
impl AddAssign<Dtz> for Dtz
sourcefn add_assign(&mut self, other: Dtz)
fn add_assign(&mut self, other: Dtz)
Performs the
+=
operation. Read moresourceimpl Ord for Dtz
impl Ord for Dtz
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Dtz> for Dtz
impl PartialOrd<Dtz> for Dtz
sourcefn partial_cmp(&self, other: &Dtz) -> Option<Ordering>
fn partial_cmp(&self, other: &Dtz) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl SubAssign<Dtz> for Dtz
impl SubAssign<Dtz> for Dtz
sourcefn sub_assign(&mut self, other: Dtz)
fn sub_assign(&mut self, other: Dtz)
Performs the
-=
operation. Read moreimpl Copy for Dtz
impl Eq for Dtz
impl StructuralEq for Dtz
impl StructuralPartialEq for Dtz
Auto Trait Implementations
impl RefUnwindSafe for Dtz
impl Send for Dtz
impl Sync for Dtz
impl Unpin for Dtz
impl UnwindSafe for Dtz
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more