Islands.Coord (Islands Coord v0.1.16) View Source

Creates a coord struct for the Game of Islands.

Based on the book Functional Web Development by Lance Halvorsen.

Link to this section Summary

Link to this section Types

Specs

col() :: 1..10

Specs

row() :: 1..10

Specs

square() :: 1..100

Specs

t() :: %Islands.Coord{col: col(), row: row()}

Link to this section Functions

Specs

new(square()) :: {:ok, t()} | {:error, atom()}

Specs

new(row(), col()) :: {:ok, t()} | {:error, atom()}

Specs

to_row_col(t()) :: String.t() | {:error, atom()}

Specs

to_square(t()) :: square() | {:error, atom()}