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
islands()
View Sourceislands() :: %{optional(Islands.Island.type()) => Islands.Island.t()}
Link to this type
t()
View Sourcet() :: %Islands.Board{islands: islands(), misses: Islands.Island.coords()}
Link to this section Functions
Link to this function
forested_types(board)
View Sourceforested_types(t()) :: [Islands.Island.type()]
Link to this function
grid_positions(board)
View Sourcegrid_positions(t()) :: %{optional(Islands.Island.type()) => map()}
Link to this function
guess(board, guess)
View Sourceguess(t(), Islands.Coord.t()) :: Islands.Board.Response.t()
Link to this function
hit_cells(board)
View Sourcehit_cells(t()) :: %{optional(Islands.Island.type()) => [<<_::2, _::_*8>>]}
Link to this function
miss_squares(board)
View Sourcemiss_squares(t()) :: %{squares: [Islands.Coord.square()]}
Link to this function
position_island(board, island)
View Sourceposition_island(t(), Islands.Island.t()) :: t() | {:error, atom()}