View Source Briscola.Strategy.Simulator (Briscola v0.1.1)
A module for simulating games of Briscola using different strategies.
Summary
Functions
Create a new simulator with a game and a list of strategies. Player 0 will use the first strategy, player 1 the second, and so on.
Simulate until the game is over.
Simulate a single turn in the game. That may mean playing a card, scoring a trick then redealing, or ending the game.
Types
@type log_message() :: {:game_over, [Briscola.Player.t()]} | {:trick_winner, integer()} | {:player_turn, integer(), Briscola.Card.t()} | {:start, Briscola.Game.t()}
@type new_options() :: [{:on_message, (Briscola.Game.t(), log_message() -> any())}]
@type t() :: %Briscola.Strategy.Simulator{ game: Briscola.Game.t(), log: [log_message()], on_message: (log_message() -> any()), strategies: [module()] }
Functions
Create a new simulator with a game and a list of strategies. Player 0 will use the first strategy, player 1 the second, and so on.
Simulate until the game is over.
Simulate a single turn in the game. That may mean playing a card, scoring a trick then redealing, or ending the game.