Islands Coord v0.1.10 Islands.Coord 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

Link to this type

square()

View Source
square() :: 1..100
Link to this type

t()

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

Link to this section Functions

Link to this function

new(square)

View Source
new(square()) :: {:ok, t()} | {:error, atom()}
Link to this function

new(row, col)

View Source
new(row(), col()) :: {:ok, t()} | {:error, atom()}
Link to this function

to_row_col(coord)

View Source
to_row_col(Islands.Coord.t()) :: String.t() | {:error, atom()}
Link to this function

to_square(coord)

View Source
to_square(Islands.Coord.t()) :: square() | {:error, atom()}