games.tic_tac_toe.ui¶
Rich UI Game Runner for Tic Tac Toe.
This module provides a beautiful, interactive UI for running Tic Tac Toe games using the Rich library for enhanced terminal displays.
Classes¶
Rich UI runner for Tic Tac Toe games. |
Module Contents¶
- class games.tic_tac_toe.ui.RichTicTacToeRunner(agent)¶
Rich UI runner for Tic Tac Toe games.
Initialize the Rich UI runner.
- Parameters:
agent (haive.games.tic_tac_toe.agent.TicTacToeAgent) – The TicTacToe agent to run
- create_analysis_panel(state)¶
Create a panel showing the latest analysis.
- Parameters:
state (haive.games.tic_tac_toe.state.TicTacToeState) – Current game state
- Returns:
Rich Panel with analysis info, or None if no analysis
- Return type:
rich.panel.Panel | None
- create_board_panel(state)¶
Create a rich panel displaying the game board.
- Parameters:
state (haive.games.tic_tac_toe.state.TicTacToeState) – Current game state
- Returns:
Rich Panel with the game board
- Return type:
rich.panel.Panel
- create_game_info_panel(state)¶
Create a panel with game information.
- Parameters:
state (haive.games.tic_tac_toe.state.TicTacToeState) – Current game state
- Returns:
Rich Panel with game info
- Return type:
rich.panel.Panel
- create_layout(state)¶
Create the main layout for the game display.
- Parameters:
state (haive.games.tic_tac_toe.state.TicTacToeState) – Current game state
- Returns:
Rich Layout object
- Return type:
rich.layout.Layout
- run_game(show_thinking=True, step_delay=1.0, debug=False)¶
Run the Tic Tac Toe game with Rich UI.
- show_game_summary(final_state)¶
Show a summary of the completed game.