Islands Grid v0.1.8 Islands.Grid View Source
Creates a grid
(map of maps) for the Game of Islands.
Convenience module for client applications.
Converts a board
or guesses
struct to a grid
(map of maps).
Also converts a board
or guesses
struct to a list of maps.
Inspired by the book Functional Web Development by Lance Halvorsen.
Link to this section Summary
Functions
Returns an "empty" grid.
Converts a board
or guesses
struct to a grid
(map of maps).
Converts a board
or guesses
struct to a list of maps.
Link to this section Types
Link to this type
t()
View Sourcet() :: %{ optional(Islands.Coord.row()) => %{optional(Islands.Coord.col()) => atom()} }
Link to this section Functions
Returns an "empty" grid.
Link to this function
new(board_or_guesses)
View Sourcenew(Islands.Board.t() | Islands.Guesses.t()) :: t()
Converts a board
or guesses
struct to a grid
(map of maps).
Link to this function
to_maps(board_or_guesses, fun \\ &Tile.new/1)
View Sourceto_maps(Islands.Board.t() | Islands.Guesses.t(), tile_fun()) :: [map()]
Converts a board
or guesses
struct to a list of maps.