View Source Buzzword.Bingo.Player (Buzzword Bingo Player v0.1.3)
Creates a player struct for the Multi-Player Bingo game.
The player struct contains the fields name
and color
representing the
characteristics of a player in the Multi-Player Bingo game.
Based on the course Multi-Player Bingo by Mike and Nicole Clark.
Link to this section Summary
Functions
Creates a player struct with the given name
and color
.
Link to this section Types
Link to this section Functions
Creates a player struct with the given name
and color
.
examples
Examples
iex> alias Buzzword.Bingo.Player
iex> Player.new("Helen", "#f9cedf")
%Player{name: "Helen", color: "#f9cedf"}
iex> alias Buzzword.Bingo.Player
iex> Player.new("Jimmy", "deep_sky_blue")
%Player{name: "Jimmy", color: "deep_sky_blue"}
iex> alias Buzzword.Bingo.Player
iex> Player.new("Jane", 'red')
{:error, :invalid_player_args}