Finish homework
This commit is contained in:
@@ -61,8 +61,19 @@ if __name__ == "__main__":
|
||||
print(f"{passed}/{len(tests)} tests passed.")
|
||||
|
||||
# Load machine
|
||||
machine = MaMa(prog, [4,6])
|
||||
machine = MaMa(prog, [4, 6])
|
||||
journal = machine.run()
|
||||
|
||||
with open("run.txt", "w") as f:
|
||||
i = 1
|
||||
for step in journal:
|
||||
s = step["p_stack"]
|
||||
p = step["p_prog"]
|
||||
S = tuple(step["stack"].values())
|
||||
f.write(f"{i}: ({s},{p},{S})\n")
|
||||
i += 1
|
||||
|
||||
# Visualize finished execution using journal
|
||||
machine = MaMa(prog, [4, 6])
|
||||
gui = MaMaGUI(machine)
|
||||
gui.display()
|
||||
|
||||
Reference in New Issue
Block a user