View Source Islands.Tally (Islands Tally v0.1.27)

Creates a tally struct for the Game of Islands. Also displays the summary of a Game of Islands.

The tally struct contains the fields game_state, player1_state, player2_state, request, response, board, board_score, guesses and guesses_score representing the characteristics of a tally in the Game of Islands.

Inspired by the book Functional Web Development by Lance Halvorsen.
Also inspired by the course Elixir for Programmers by Dave Thomas.

Summary

Types

t()

A tally struct for the Game of Islands

Functions

Creates a tally struct for the specified player.

Displays the summary of a game for the specified player.

Types

@type t() :: %Islands.Tally{
  board: Islands.Board.t(),
  board_score: Islands.Score.t(),
  game_state: Islands.State.game_state(),
  guesses: Islands.Guesses.t(),
  guesses_score: Islands.Score.t(),
  player1_state: Islands.State.player_state(),
  player2_state: Islands.State.player_state(),
  request: Islands.Request.t(),
  response: Islands.Response.t()
}

A tally struct for the Game of Islands

Functions

@spec new(Islands.Game.t(), Islands.PlayerID.t()) :: t() | {:error, atom()}

Creates a tally struct for the specified player.

Link to this function

summary(tally, player_id, message \\ [])

View Source
@spec summary(t(), Islands.PlayerID.t(), IO.ANSI.Plus.ansilist()) :: :ok

Displays the summary of a game for the specified player.