Islands Island v0.1.2 Islands.Island View Source

Models an island 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

t() View Source
t() :: %Islands.Island{coords: coords(), hits: coords(), type: type()}

Link to this type

type() View Source
type() :: :atoll | :dot | :l_shape | :s_shape | :square

Link to this section Functions

Link to this function

forested?(island) View Source
forested?(t()) :: boolean()

Link to this function

guess(island, guess) View Source
guess(t(), Islands.Coord.t()) :: {:hit, t()} | :miss

Link to this function

new(type, origin) View Source
new(type(), Islands.Coord.t()) :: {:ok, t()} | {:error, atom()}

Link to this function

overlaps?(island, new_island) View Source
overlaps?(t(), t()) :: boolean()