# [−][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 <= -1`LossUnconditional loss (assuming the 50-move counter is zero). Zeroing move can be forced in `-n` plies.
`n < -100`Blessed 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 < n`Cursed 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 <= 100`WinUnconditional 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 Ord for Dtz`[src]

#### `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

#### `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 Clone for Dtz`[src]

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

Performs copy-assignment from `source`. Read more

### `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.

## Blanket Implementations

### `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.