Islands.Board (Islands Board v0.1.18) View Source
Models a board
in the Game of Islands.
Based on the book Functional Web Development by Lance Halvorsen.
Link to this section Summary
Link to this section Types
Specs
islands() :: %{required(Islands.Island.type()) => Islands.Island.t()}
Specs
t() :: %Islands.Board{islands: islands(), misses: Islands.Island.coords()}
Link to this section Functions
Specs
Specs
forested_types(t()) :: [Islands.Island.type()]
Specs
grid_positions(t()) :: %{required(Islands.Island.type()) => map()}
Specs
guess(t(), Islands.Coord.t()) :: Islands.Board.Response.t()
Specs
hit_cells(t()) :: %{required(Islands.Island.type()) => [<<_::2, _::_*8>>]}
Specs
hits(t()) :: non_neg_integer()
Specs
miss_squares(t()) :: %{squares: [Islands.Coord.square()]}
Specs
misses(t()) :: non_neg_integer()
Specs
new() :: t()
Specs
position_island(t(), Islands.Island.t()) :: t() | {:error, atom()}