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. |
Methods
impl Dtz
[src]
pub fn before_zeroing(wdl: Wdl) -> 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 Debug for Dtz
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Copy for Dtz
[src]
impl Clone for Dtz
[src]
fn clone(&self) -> Dtz
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Dtz
[src]
impl PartialEq for Dtz
[src]
fn eq(&self, __arg_0: &Dtz) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Dtz) -> bool
[src]
This method tests for !=
.
impl Ord for Dtz
[src]
fn cmp(&self, __arg_0: &Dtz) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl PartialOrd for Dtz
[src]
fn partial_cmp(&self, __arg_0: &Dtz) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Dtz) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Dtz) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Dtz) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Dtz) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl From<Dtz> for i32
[src]
impl From<Dtz> for i64
[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 Neg for Dtz
[src]
type Output = Dtz
The resulting type after applying the -
operator.
fn neg(self) -> Dtz
[src]
Performs the unary -
operation.
impl Add for Dtz
[src]
type Output = Dtz
The resulting type after applying the +
operator.
fn add(self, other: Dtz) -> Dtz
[src]
Performs the +
operation.
impl AddAssign for Dtz
[src]
fn add_assign(&mut self, other: Dtz)
[src]
Performs the +=
operation.
impl Sub for Dtz
[src]
type Output = Dtz
The resulting type after applying the -
operator.
fn sub(self, other: Dtz) -> Dtz
[src]
Performs the -
operation.
impl SubAssign for Dtz
[src]
fn sub_assign(&mut self, other: Dtz)
[src]
Performs the -=
operation.