games.hold_em.example¶

Example usage of the Texas Hold’em poker implementation.

This example script demonstrates how to:
  • Create and configure a Texas Hold’em game

  • Set up player agents with different playing styles

  • Run a complete game with the Rich UI

  • Access and analyze game results

Run this script directly to see a Hold’em game in action.

Functions¶

analyze_game_results(agent)

Analyze the results of a completed game.

create_custom_game(player_names[, player_styles, ...])

Create a custom Hold'em game with specified players and settings.

main()

Main entry point with command line argument handling.

run_example_game([game_type, delay])

Run an example Hold'em game with the specified configuration.

Module Contents¶

games.hold_em.example.analyze_game_results(agent)¶

Analyze the results of a completed game.

Parameters:

agent (haive.games.hold_em.HoldemGameAgent) – The game agent after running a game

games.hold_em.example.create_custom_game(player_names, player_styles=None, starting_chips=1000, small_blind=10, big_blind=20, max_hands=50)¶

Create a custom Hold’em game with specified players and settings.

Parameters:
  • player_names (list[str]) – List of player names

  • player_styles (list[str] | None) – Optional list of player styles (defaults to “balanced” for all)

  • starting_chips (int) – Starting chips per player

  • small_blind (int) – Small blind amount

  • big_blind (int) – Big blind amount

  • max_hands (int) – Maximum hands to play

Returns:

Configured game agent ready to run

Return type:

HoldemGameAgent

games.hold_em.example.main()¶

Main entry point with command line argument handling.

games.hold_em.example.run_example_game(game_type='default', delay=1.5)¶

Run an example Hold’em game with the specified configuration.

Parameters:
  • game_type (str) – Type of game to run (“default”, “heads-up”, “tournament”, “cash”, “custom”)

  • delay (float) – Delay between UI updates (seconds)