Interface
- pygammon.run(receive_input: Callable[[Side], Tuple[InputType, Tuple[int, int | None] | None]], send_output: SendOutputCallable, move_by_turn_rolls: bool = False) None
Start a game, using given callables for player input and output.
- Parameters:
receive_input – Callable receiving player input
send_output – Callable sending player output
move_by_turn_rolls – Whether the starting player should move by the turn-deciding die rolls, on their first turn
- class pygammon.structures.Point(side: Side | None = None, count: int = 0)
Bases:
object
Board point data
- class pygammon.GameState(board: List[Point], first_hit: int, first_borne: int, second_hit: int, second_borne: int)
Bases:
tuple
Game state data
- class pygammon.OutputType(value)
Bases:
Enum
Reason to send output
- GAME_STATE = 0
- TURN_ROLLS = 1
- MOVE_ROLLS = 2
- INVALID_MOVE = 3
- GAME_WON = 4