yahtzee-engine 0.1.0

Yahtzee rules, scoring, and bots: a fast heuristic and an exact optimal expected-value solver
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! The one decision a Yahtzee turn ever poses.

use crate::{Category, Keep};

/// What to do with the dice on the table: hold some and reroll the rest,
/// or write a category now.
///
/// Scoring early is always legal; rerolling is legal only while rolls
/// remain, which the [`Game`](crate::Game) enforces at runtime.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum TurnAction {
    /// Hold exactly these dice and reroll the others.
    Reroll(Keep),
    /// End the turn by scoring this category.
    Score(Category),
}