View Source Islands.Score (Islands Score v0.1.36)
A score struct and functions for the Game of Islands.
The score struct contains the fields name, gender, hits, misses and forested_types representing the characteristics of a score in the Game of Islands.
Inspired by the book Functional Web Development by Lance Halvorsen.
Link to this section Summary
Functions
Creates a score struct from a player's board struct.
Prints score formatted with embedded ANSI escapes.
Creates a score struct from an opponent's board struct.
Link to this section Types
Specs
t() :: %Islands.Score{
forested_types: [Islands.Island.type()],
gender: Islands.Player.gender(),
hits: non_neg_integer(),
misses: non_neg_integer(),
name: Islands.Player.name()
}
A score struct for the Game of Islands
Link to this section Functions
Specs
board_score(Islands.Game.t(), Islands.PlayerID.t()) :: t()
Creates a score struct from a player's board struct.
Specs
Prints score formatted with embedded ANSI escapes.
Specs
guesses_score(Islands.Game.t(), Islands.PlayerID.t()) :: t()
Creates a score struct from an opponent's board struct.