[aoc] silence more of the tests

This commit is contained in:
2021-04-28 19:54:34 -06:00
parent fcf422386d
commit 14b46091bc
2 changed files with 5 additions and 7 deletions

View File

@@ -17,22 +17,19 @@
(stream.dropWhitespace) (stream.dropWhitespace)
`(cond `(cond
((or self.forked (instructionsTested.exists self.instructionPointer)) ((or self.forked (instructionsTested.exists self.instructionPointer))
(print "can't fork again")
(,instSymbol (,op 0 ,arg) self)) (,instSymbol (,op 0 ,arg) self))
(true (true
(dictSet instructionsTested self.instructionPointer true) (dictSet instructionsTested self.instructionPointer true)
(self.setBreakPoint) (self.setBreakPoint)
(self.fork [ (self.fork [
(lambda [:Dynamic self] (lambda [:Dynamic self]
(print self.accumulator)
(when ,(ReaderExp.Symbol (Std.string (= inst "nop"))) (when ,(ReaderExp.Symbol (Std.string (= inst "nop")))
(print (set self.forked true)) (set self.forked true)
(set self.forkedAt self.instructionPointer)) (set self.forkedAt self.instructionPointer))
(jmp (,op 0 ,arg) self)) (jmp (,op 0 ,arg) self))
(lambda [:Dynamic self] (lambda [:Dynamic self]
(print self.accumulator)
(when ,(ReaderExp.Symbol (Std.string (= inst "jmp"))) (when ,(ReaderExp.Symbol (Std.string (= inst "jmp")))
(print (set self.forked true)) (set self.forked true)
(set self.forkedAt self.instructionPointer)) (set self.forkedAt self.instructionPointer))
(nop (,op 0 ,arg) self)) (nop (,op 0 ,arg) self))
]))))) ])))))

View File

@@ -96,7 +96,7 @@
(bootCode.setBreakHandler (lambda [bootCode] (assert (= 2058 (print bootCode.accumulator))))) (bootCode.setBreakHandler (lambda [bootCode] (assert (= 2058 (print bootCode.accumulator)))))
(bootCode.run)) (bootCode.run))
(print "BootCodeFixExample") (print "BootCodeFixExample")
(let [bootCode (new BootCodeFixExample)] /* (let [bootCode (new BootCodeFixExample)]
(bootCode.setBreakHandler (bootCode.setBreakHandler
(lambda [bootCodeFork] (lambda [bootCodeFork]
(if (= bootCodeFork.instructionPointer (bootCodeFork.instructionCount)) (if (= bootCodeFork.instructionPointer (bootCodeFork.instructionCount))
@@ -112,7 +112,8 @@
(print (+ "answer could be " (Std.string bootCodeFork.accumulator) " forked at " (Std.string (+ 1 bootCodeFork.forkedAt)))) (print (+ "answer could be " (Std.string bootCodeFork.accumulator) " forked at " (Std.string (+ 1 bootCodeFork.forkedAt))))
(print "hit an infinite loop")))) (print "hit an infinite loop"))))
(bootCode.addBreakPoint (bootCode.instructionCount)) (bootCode.addBreakPoint (bootCode.instructionCount))
(bootCode.run))) (bootCode.run)) */
)
// Day 9 // Day 9
(when (<= 0 (days.indexOf 9)) (when (<= 0 (days.indexOf 9))