Buzzword.Bingo.Engine (Buzzword Bingo Engine v0.1.36)
View SourceModels the Multi-Player Buzzword Bingo game.
Based on the course Multi-Player Bingo by Mike and Nicole Clark.
Summary
Functions
Stops a game server process normally. It won't be restarted.
Returns a sorted list of registered game names.
Returns the pid of the game server process registered via the
given game_name
, or nil
if no such process is registered.
Returns the summary of a game.
Generates a unique, URL-friendly name such as "bold-frog-8249".
Marks a square with a player.
Starts a new game server process and supervises it.
Prints the summary of a game as a formatted table.
Functions
@spec end_game(Buzzword.Bingo.Game.name()) :: :ok | {:error, term()}
Stops a game server process normally. It won't be restarted.
@spec game_names() :: [Buzzword.Bingo.Game.name() | atom()]
Returns a sorted list of registered game names.
@spec game_pid(Buzzword.Bingo.Game.name()) :: pid() | nil
Returns the pid of the game server process registered via the
given game_name
, or nil
if no such process is registered.
@spec game_summary(Buzzword.Bingo.Game.name()) :: Buzzword.Bingo.Summary.t() | {:error, term()}
Returns the summary of a game.
@spec haiku_name() :: Buzzword.Bingo.Game.name()
Generates a unique, URL-friendly name such as "bold-frog-8249".
@spec mark_square( Buzzword.Bingo.Game.name(), Buzzword.Bingo.Square.phrase(), Buzzword.Bingo.Player.t() ) :: Buzzword.Bingo.Summary.t() | {:error, term()}
Marks a square with a player.
@spec new_game(Buzzword.Bingo.Game.name(), Buzzword.Bingo.Game.size()) :: Supervisor.on_start_child()
Starts a new game server process and supervises it.
@spec print_summary(Buzzword.Bingo.Game.name()) :: :ok | {:error, term()}
Prints the summary of a game as a formatted table.