diff --git a/scripts/run_zork1.py b/scripts/run_zork1.py index 78c3985..f4d7f2d 100755 --- a/scripts/run_zork1.py +++ b/scripts/run_zork1.py @@ -1,12 +1,17 @@ #!/usr/bin/env -S uv run --script """Smoke test for hybrid z-machine interpreter with Zork 1.""" +import argparse import sys import traceback from pathlib import Path def main(): + parser = argparse.ArgumentParser(description="Run Zork 1 in Z-machine interpreter") + parser.add_argument("--debug", action="store_true", help="Enable debug mode") + args = parser.parse_args() + # Add src to path so we can import mudlib project_root = Path(__file__).parent.parent sys.path.insert(0, str(project_root / "src")) @@ -38,9 +43,11 @@ def main(): print(f"Loaded {len(story_bytes)} bytes") print() print("Creating ZUI and ZMachine instance...") + if args.debug: + print("Debug mode: ENABLED") ui = create_zui() - zmachine = ZMachine(story_bytes, ui, debugmode=False) + zmachine = ZMachine(story_bytes, ui, debugmode=args.debug) print("Starting interpreter...") print("(Press Ctrl+C to exit)")