Encapsulate EmbeddedScript variables

This commit is contained in:
2020-12-09 13:03:50 -07:00
parent dc44118c5b
commit b8492c1e8e
2 changed files with 13 additions and 5 deletions

View File

@@ -80,9 +80,9 @@
// Day 8
(let [example (new BootCodeExample)]
(set example.onBreak (lambda [] (assert (= 5 example.accumulator))))
(example.setBreakHandler (lambda [] (assert (= 5 example.accumulator))))
(example.run))
(let [bootCode (new BootCodeReal)]
(set bootCode.onBreak (lambda [] (assert (= 2058 bootCode.accumulator) (assert true))))
(bootCode.setBreakHandler (lambda [] (assert (= 2058 bootCode.accumulator) (assert true))))
(bootCode.run)))