games.mafia.simple_runner¶

Simple runner for the Mafia game that avoids LangGraph issues.

This module provides a simplified version of the Mafia game runner that avoids the streaming issues in LangGraph by:

  • Using direct state manipulation instead of graph streaming

  • Following the game logic manually through phases

  • Providing the same visualization and game experience

Example

`bash python simple_runner.py --players 7 --days 3 --debug `

Functions¶

main()

Main entry point for command-line execution.

run_mafia_game_simple([player_count, max_days, debug])

Run a simplified Mafia game simulation with direct state management.

Module Contents¶

games.mafia.simple_runner.main()¶

Main entry point for command-line execution.

Return type:

None

games.mafia.simple_runner.run_mafia_game_simple(player_count=5, max_days=1, debug=True)¶

Run a simplified Mafia game simulation with direct state management.

This function sets up and executes a full Mafia game, handling:
  • Player creation and role assignment

  • Game state initialization

  • Turn-based gameplay execution

  • State visualization

  • Game end conditions

Parameters:
  • player_count (int) – Total number of players including narrator. Must be at least 4 (3 players + narrator). Defaults to 5.

  • max_days (int) – Maximum number of in-game days before forcing game end. Defaults to 3.

  • debug (bool) – Enable debug mode for detailed logging. Defaults to True.

Raises:

ValueError – If player_count is less than 4.

Return type:

None