pygambit.gambit.Game.add_player#

Game.add_player(label: str) Player#

Add a new player to the game.

Changed in version 16.7.0: A label is now required and must be nonempty and unique among the game’s players. In extensive games, the label cannot be "Chance", which is reserved for the chance player.

Parameters:

label (str) – The label for the new player. Must be nonempty and not the same as the label of an existing player in the game.

Returns:

A reference to the newly-created player.

Return type:

Player

Raises:

ValueError – If label is empty, is already the label of another player, or (in an extensive game) is "Chance", the reserved label of the chance player.