Islands Score v0.1.3 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()
View Source
forested_types() :: [Islands.Island.type()]
forested_types() :: [Islands.Island.type()]
Link to this type
hits()
View Source
hits()
View Source
hits() :: non_neg_integer()
hits() :: non_neg_integer()
Link to this type
misses()
View Source
misses()
View Source
misses() :: non_neg_integer()
misses() :: non_neg_integer()
Link to this type
t()
View Source
t()
View Source
t() :: %Islands.Score{
forested_types: forested_types(),
hits: hits(),
misses: misses()
}
t() :: %Islands.Score{ forested_types: forested_types(), hits: hits(), misses: misses() }
Link to this section Functions
Link to this function
new(board)
View Source
new(board)
View Source
new(Islands.Board.t()) :: t()
new(Islands.Board.t()) :: t()
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, []}