Islands Score v0.1.5 Islands.Score View Source

Creates a score struct for the Game of Islands.

Inspired by the book Functional Web Development by Lance Halvorsen.

Link to this section Summary

Functions

Creates a score struct for the Game of Islands

Link to this section Types

Link to this type

forested_types() View Source
forested_types() :: [Islands.Island.type()]

Link to this type

t() View Source
t() :: %Islands.Score{
  forested_types: forested_types(),
  hits: hits(),
  misses: misses()
}

Link to this section Functions

Creates a score struct for the Game of Islands.

Examples

iex> alias Islands.{Board, Score}
iex> %Score{
...>   hits: hits,
...>   misses: misses,
...>   forested_types: forested_types
...> } = Board.new() |> Score.new()
iex> {hits, misses, forested_types}
{0, 0, []}