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

t()

A summary struct for the Multi-Player Buzzword Bingo game

Functions

Creates a summary struct from the given game.

Types

player_score()

@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

score()

@type score() :: {Buzzword.Bingo.Player.name(), player_score()}

A tuple of player name and player score

scores()

@type scores() :: %{required(Buzzword.Bingo.Player.name()) => player_score()}

A serializable map assigning player scores to player names

t()

@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

new(game)

@spec new(Buzzword.Bingo.Game.t()) :: t() | {:error, atom()}

Creates a summary struct from the given game.

print(summary_or_game)

@spec print(t() | Buzzword.Bingo.Game.t()) :: :ok

See Buzzword.Bingo.Summary.Formatter.print/1.