View Source Buzzword.Bingo.Summary (Buzzword Bingo Summary v0.1.43)
A summary struct and functions for the Multi-Player Buzzword Bingo game.
The summary struct contains the fields squares
, scores
and winner
representing the properties of a summary in the Multi-Player Buzzword Bingo
game.
Based on the course Multi-Player Bingo by Mike and Nicole Clark.
Summary
Types
A map of player attributes
A tuple of player name and player score
A serializable map assigning player scores to player names
A summary struct for the Multi-Player Buzzword Bingo game
Functions
Creates a summary struct from the given game
.
Types
@type player_score() :: %{ color: Buzzword.Bingo.Player.color(), score: Buzzword.Bingo.Game.points_sum(), marked: Buzzword.Bingo.Game.marked_count() }
A map of player attributes
@type score() :: {Buzzword.Bingo.Player.name(), player_score()}
A tuple of player name and player score
@type scores() :: %{required(Buzzword.Bingo.Player.name()) => player_score()}
A serializable map assigning player scores to player names
@type t() :: %Buzzword.Bingo.Summary{ scores: scores(), squares: [[Buzzword.Bingo.Square.t()]], winner: Buzzword.Bingo.Player.t() | nil }
A summary struct for the Multi-Player Buzzword Bingo game
Functions
@spec new(Buzzword.Bingo.Game.t()) :: t() | {:error, atom()}
Creates a summary struct from the given game
.
@spec print(t() | Buzzword.Bingo.Game.t()) :: :ok