TicTacToe.Game (tic_tac_toe v2.0.0) View Source

Functions to modify the game state.

Link to this section Summary

Link to this section Types

Specs

mode() :: :original | :notakto | :misere

Specs

t() :: %TicTacToe.Game{
  board: TicTacToe.Board.t(),
  current_player: nil | TicTacToe.Board.player(),
  game_mode: mode(),
  winner: TicTacToe.Scoring.t()
}

Link to this section Functions

Specs

computer_move(t()) :: t()
Link to this function

computer_move(game, position)

View Source

Specs

computer_move(t(), TicTacToe.Board.position()) :: t()
Link to this function

new(game_mode \\ :original)

View Source

Specs

new(mode()) :: t()

Specs

over?(t()) :: boolean()
Link to this function

player_move(game, position)

View Source

Specs

player_move(t(), TicTacToe.Board.position()) :: t()

Specs

score(t()) :: t()