Add bingo
to your list of dependencies in mix.exs
:
def deps do
[
{:bingo, path: "../bingo"}
]
end
If available in Hex, the package can be installed by adding bingo
to your list of dependencies in mix.exs
:
def deps do
[
{:bingo, "~> 0.1.0"}
]
end
Here's how to spawn a game server process and play a game from an iex
session:
-
Spawn a new game server process with the name "icy-sun" and a 3x3 grid of randomly-generated squares:
iex> {:ok, pid} = Bingo.GameSupervisor.start_game("icy-sun", 3)
-
Get a summary of the game:
iex> summary = Bingo.GameServer.summary("icy-sun")
-
Mark the square represented by the phrase "Upsell" by the player (replace "Upsell" with a phrase from your game):
iex> player = Bingo.Player.new("Nicole", "green") iex> summary = Bingo.GameServer.mark("icy-sun", "Upsell", player)
-
Print a textual representation of the game:
iex> Bingo.GameDisplay.display(summary)
mix test