games.monopoly.standalone_demo¶

Standalone Monopoly demo with minimal dependencies.

This script provides a self-contained demonstration of the Monopoly game without relying on external dependencies like langchain.

Usage:

python standalone_demo.py

Classes¶

PropertyColor

str(object='') -> str

PropertyType

str(object='') -> str

Functions¶

calculate_rent(property_obj, state[, dice_roll])

Calculate rent for a property.

create_board()

Create the initial board with all properties.

create_players(player_names)

Create initial players.

get_property_at_position(position)

Get property information at a board position.

handle_property_landing(state, position)

Handle a player landing on a property.

move_player(player, dice_roll)

Move a player based on dice roll.

print_divider()

Print a divider line.

print_player_status(state)

Print current status of all players.

print_property(property_obj)

Print property details.

print_recent_events(events[, count])

Print recent game events.

roll_dice()

Roll two dice.

run_demo([turns])

Run a simple Monopoly game demo.

Module Contents¶

class games.monopoly.standalone_demo.PropertyColor¶

Bases: str, enum.Enum

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

Initialize self. See help(type(self)) for accurate signature.

class games.monopoly.standalone_demo.PropertyType¶

Bases: str, enum.Enum

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

Initialize self. See help(type(self)) for accurate signature.

games.monopoly.standalone_demo.calculate_rent(property_obj, state, dice_roll=None)¶

Calculate rent for a property.

Parameters:
  • property_obj (Property)

  • state (GameState)

  • dice_roll (int | None)

Return type:

int

games.monopoly.standalone_demo.create_board()¶

Create the initial board with all properties.

Return type:

dict[str, Property]

games.monopoly.standalone_demo.create_players(player_names)¶

Create initial players.

Parameters:

player_names (list[str])

Return type:

list[Player]

games.monopoly.standalone_demo.get_property_at_position(position)¶

Get property information at a board position.

Parameters:

position (int)

Return type:

dict | None

games.monopoly.standalone_demo.handle_property_landing(state, position)¶

Handle a player landing on a property.

Parameters:
Return type:

list[GameEvent]

games.monopoly.standalone_demo.move_player(player, dice_roll)¶

Move a player based on dice roll.

Parameters:
  • player (Player)

  • dice_roll (DiceRoll)

Return type:

tuple[int, bool]

games.monopoly.standalone_demo.print_divider()¶

Print a divider line.

games.monopoly.standalone_demo.print_player_status(state)¶

Print current status of all players.

Parameters:

state (GameState)

games.monopoly.standalone_demo.print_property(property_obj)¶

Print property details.

Parameters:

property_obj (Property)

games.monopoly.standalone_demo.print_recent_events(events, count=5)¶

Print recent game events.

Parameters:
  • events (list[GameEvent])

  • count (int)

games.monopoly.standalone_demo.roll_dice()¶

Roll two dice.

Return type:

DiceRoll

games.monopoly.standalone_demo.run_demo(turns=10)¶

Run a simple Monopoly game demo.

Parameters:

turns (int)