From 2cf303dd670cd0a26fda3f9a5f321af105b84a9b Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Mon, 9 Feb 2026 21:47:39 -0500 Subject: [PATCH] Add --debug flag to Zork 1 smoke test --- scripts/run_zork1.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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)")