yatzy v1.0.0 Yatzy.Scoring View Source
Utility functions for calculating scores of a given roll.
Link to this section Summary
Functions
Checking what is the highest pair, trips, square, etc and the running total
Counting how many dice show a given number and summing the matching dice
Link to this section Types
Link to this type
t()
View Sourcet() :: %Yatzy.Scoring{
description: String.t(),
name: String.t(),
roll: Yatzy.Roll.t(),
score: String.t() | nil
}
Link to this section Functions
Checking what is the highest pair, trips, square, etc and the running total
Examples
iex> Yatzy.Scoring.chunk_by([1, 1, 3, 3, 4], 2)
6
Counting how many dice show a given number and summing the matching dice
Examples
iex> Yatzy.Scoring.count([1, 2, 3, 3, 3], 3)
9