Islands Guesses v0.1.12 Islands.Guesses View Source

Creates a guesses struct for the Game of Islands.

Based on the book Functional Web Development by Lance Halvorsen.

Link to this section Summary

Link to this section Types

Link to this type

t()

View Source
t() :: %Islands.Guesses{
  hits: Islands.Island.coords(),
  misses: Islands.Island.coords()
}
Link to this type

type()

View Source
type() :: :hit | :miss

Link to this section Functions

Link to this function

add(guesses, type, guess)

View Source
add(t(), type(), Islands.Coord.t()) :: t() | {:error, atom()}
Link to this function

hit_squares(guesses)

View Source
hit_squares(t()) :: %{squares: [Islands.Coord.square()]}
Link to this function

miss_squares(guesses)

View Source
miss_squares(t()) :: %{squares: [Islands.Coord.square()]}