Islands Board v0.1.10 Islands.Board 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

Link to this type

t()

View Source
t() :: %Islands.Board{islands: islands(), misses: Islands.Island.coords()}

Link to this section Functions

Link to this function

all_islands_positioned?(board)

View Source
all_islands_positioned?(t()) :: boolean()
Link to this function

forested_types(board)

View Source
forested_types(t()) :: [Islands.Island.type()]
Link to this function

grid_positions(board)

View Source
grid_positions(t()) :: %{optional(Islands.Island.type()) => map()}
Link to this function

hit_cells(board)

View Source
hit_cells(t()) :: %{optional(Islands.Island.type()) => [<<_::2, _::_*8>>]}
Link to this function

miss_squares(board)

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

position_island(board, island)

View Source
position_island(t(), Islands.Island.t()) :: t() | {:error, atom()}