Struct shakmaty_syzygy::Dtz [−][src]
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.
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. |
Implementations
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.
WDL | DTZ |
---|---|
Loss | -1 |
Blessed loss | -101 |
Draw | 0 |
Cursed win | 101 |
Win | 1 |
pub fn add_plies(self, plies: i32) -> Dtz
[src]
Increases the absolute value by plies
.
Trait Implementations
impl Add<Dtz> for Dtz
[src]
type Output = Dtz
The resulting type after applying the +
operator.
fn add(self, other: Dtz) -> Dtz
[src]
impl AddAssign<Dtz> for Dtz
[src]
fn add_assign(&mut self, other: Dtz)
[src]
impl Clone for Dtz
[src]
impl Copy for Dtz
[src]
impl Debug for Dtz
[src]
impl Eq for Dtz
[src]
impl From<i16> for Dtz
[src]
impl From<i32> for Dtz
[src]
impl From<i8> for Dtz
[src]
impl From<u16> for Dtz
[src]
impl From<u8> for Dtz
[src]
impl Neg for Dtz
[src]
impl Ord for Dtz
[src]
fn cmp(&self, other: &Dtz) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
pub fn max(self, other: Self) -> Self#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
pub fn min(self, other: Self) -> Self#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
#[must_use]
pub fn clamp(self, min: Self, max: Self) -> Selfimpl PartialEq<Dtz> for Dtz
[src]
impl PartialOrd<Dtz> for Dtz
[src]
fn partial_cmp(&self, other: &Dtz) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ge(&self, other: &Rhs) -> boolimpl StructuralEq for Dtz
[src]
impl StructuralPartialEq for Dtz
[src]
impl Sub<Dtz> for Dtz
[src]
type Output = Dtz
The resulting type after applying the -
operator.
fn sub(self, other: Dtz) -> Dtz
[src]
impl SubAssign<Dtz> for Dtz
[src]
fn sub_assign(&mut self, other: Dtz)
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,