Build and execute a program, returning executor for state inspection.
(instructions: list[Instruction], input_data: dict[int, Any] | None = None)
| 83 | |
| 84 | |
| 85 | def run_program(instructions: list[Instruction], input_data: dict[int, Any] | None = None): |
| 86 | """Build and execute a program, returning executor for state inspection.""" |
| 87 | from .executor import Executor |
| 88 | |
| 89 | prog = make_program(instructions) |
| 90 | ex = Executor() |
| 91 | ex.execute(prog, input_data) |
| 92 | return ex |
| 93 | |
| 94 | |
| 95 | _XQBC_MAGIC = b"XQBC" |