Islands.Board.Response (Islands Board v0.1.25) View Source
A 4-element tuple reflecting the effect of a guess (hit or miss) on a board.
Link to this section Summary
Functions
Checks if guess
hit any island on board
.
Converts a preliminary response to a guess into a full response.
Link to this section Types
Specs
guess_check() :: {:hit, Islands.Island.t()} | {:miss, Islands.Coord.t()}
Preliminary response to a guess
Specs
t() :: {:hit | :miss, Islands.Island.type() | :none, :no_win | :win, Islands.Board.t()}
Full response to a guess
Link to this section Functions
Specs
check_guess(Islands.Board.t(), Islands.Coord.t()) :: guess_check()
Checks if guess
hit any island on board
.
Returns {:hit, hit_island}
, where hit_island is the island hit by guess
once updated, or {:miss, guess}
if guess
was a miss.
Specs
format_response(guess_check(), Islands.Board.t()) :: t()
Converts a preliminary response to a guess into a full response.