No description
New file: house_parser.py — self-contained state machine for the interactive
house buy/sell dialog. Parses:
- Property prompts ('PropName (N): ') to capture current house count
- Player responses (how many to buy/sell)
- Auto-skipped prompts (hotel during buy, 0 houses during sell)
- Error retries ('spread too wide', 'too many')
- Confirmation ('Is that ok?' → y/n)
Returns a result dict with {action, changes: {sq_id: new_count}, cost}
when the dialog completes.
Integration: monop_parser feeds every line (bot + player) to HouseParser.
On result, applies house count changes to property_houses.
Tests:
- test_house_parser.py (18 tests): buy/sell basics, hotel, error retry,
real log replay (lines 59, 354, 4386)
- test_parser_commands.py: 4 new integration tests (buy, sell, reject,
real log verification)
This closes the last tracking gap — house counts are now accurate at
purchase time, not just when rent is later charged.
|
||
|---|---|---|
| __pycache__ | ||
| docs | ||
| plugins | ||
| reference | ||
| site | ||
| test_data | ||
| house_parser.py | ||
| irc_client.py | ||
| monop_bridge.py | ||
| monop_parser.py | ||
| monop_players.py | ||
| README.md | ||
| run_game.py | ||
| test_house_parser.py | ||
| test_integration.py | ||
| test_parser.py | ||
| test_parser_bugs.py | ||
| test_parser_commands.py | ||
| test_parser_resign.py | ||
| test_players.py | ||
monop-board Static Site
Visual Monopoly board viewer that reads game-state.json and displays the board.
Usage
# Serve from the site directory (game-state.json should be in this dir or parent)
cd site/
python3 -m http.server 8080
Then open http://localhost:8080 in your browser.
Features
- Classic Monopoly board layout
- Player tokens with colors and initials
- Property ownership indicators
- Houses (green) and hotels (red)
- Color-coded property groups
- Player info panels with money, properties, cards
- Game log with recent events
- Auto-refreshes every 2 seconds
- Demo mode when no live game is running
- Mobile-responsive dark theme