Islands Grid v0.1.1 Islands.Grid View Source

Creates a grid struct 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 grid 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

Converts a grid to a list of maps

Link to this section Types

Link to this type

t() View Source
t() :: %{
  optional(Islands.Coord.row()) => %{optional(Islands.Coord.col()) => atom()}
}

Link to this section Functions

Returns an "empty" grid.

Converts a board or guesses struct to a grid.

Link to this function

to_maps(grid, fun \\ &Tile.new/1) View Source
to_maps(t(), (atom() -> IO.ANSI.Plus.ansidata())) :: [map()]

Converts a grid to a list of maps.