View Source Islands.Board.Response (Islands Board v0.1.29)
A 4-element tuple reflecting the effect of a guess (hit or miss) on a board.
Summary
Functions
Checks if guess
hit any island on board
.
Converts a preliminary response to a guess into a full response.
Types
@type guess_check() :: {:hit, Islands.Island.t()} | {:miss, Islands.Coord.t()}
Preliminary response to a guess
@type t() :: {:hit | :miss, Islands.Island.type() | :none, :no_win | :win, Islands.Board.t()}
Full response to a guess
Functions
@spec 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.
@spec format_response(guess_check(), Islands.Board.t()) :: t()
Converts a preliminary response to a guess into a full response.