Islands.Grid (Islands Grid v0.1.14) 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
Specs
t() :: %{ required(Islands.Coord.row()) => %{required(Islands.Coord.col()) => atom()} }
Specs
tile_fun() :: (atom() -> IO.ANSI.Plus.ansidata())
Link to this section Functions
Specs
new() :: t()
Returns an "empty" grid.
Specs
new(Islands.Board.t() | Islands.Guesses.t()) :: t()
Converts a board
or guesses
struct to a grid
(map of maps).
Specs
to_maps(Islands.Board.t() | Islands.Guesses.t(), tile_fun()) :: [map()]
Converts a board
or guesses
struct to a list of maps.