# HG changeset patch # User Steve Losh # Date 1575834654 18000 # Node ID d692b61fbee13c48c1889ee3f354a6025e369434 # Parent 5f6c2d777533d675847360d38f653701d7d95883 More test fixes diff -r 5f6c2d777533 -r d692b61fbee1 src/2016/days/day-05.lisp --- a/src/2016/days/day-05.lisp Sun Dec 08 13:47:53 2019 -0500 +++ b/src/2016/days/day-05.lisp Sun Dec 08 14:50:54 2019 -0500 @@ -1,13 +1,15 @@ (defpackage :advent/2016/05 #.cl-user::*advent-use*) (in-package :advent/2016/05) +(defparameter *fancy* nil) (defparameter *spinner* '#1=(#\◴ #\◷ #\◶ #\◵ . #1#)) (defun string->bytes (string) (map 'vector #'char-code string)) (defun progress (i) - (format t "~C~C Iteration: ~D" #\Return (pop *spinner*) i) + (when *fancy* + (format t "~C~C Iteration: ~D" #\Return (pop *spinner*) i)) (force-output)) (defun good-hash-p (hash) @@ -51,9 +53,9 @@ (char= (aref part2 pos) #\_)) ; not already seen (setf (aref part2 pos) (aref hex 6)) (when (zerop (decf remaining)) - (format t " Cracked.~%") + (when *fancy* (format t " Cracked.~%")) (finish)))) - (format t " [~A] / [~A]~%" part1 part2) + (when *fancy* (format t " [~A] / [~A]~%" part1 part2)) (progress i)))) diff -r 5f6c2d777533 -r d692b61fbee1 src/2017/days/day-08.lisp --- a/src/2017/days/day-08.lisp Sun Dec 08 13:47:53 2019 -0500 +++ b/src/2017/days/day-08.lisp Sun Dec 08 14:50:54 2019 -0500 @@ -12,7 +12,9 @@ (macrolet ((r (register) `(gethash ,register registers 0))) (iterate (for line :in data) - (for (reg op delta nil cmp-reg cmp-op cmp-bound) := (read-all-from-string line)) + (for (reg op delta nil cmp-reg cmp-op cmp-bound) + := (let ((*package* (find-package :advent/2017/08))) + (read-all-from-string line))) (when (funcall cmp-op (r cmp-reg) cmp-bound) (maximizing (incf (r reg) (funcall op delta)) :into highest)) (finally (return (values (alexandria:extremum (alexandria:hash-table-values registers) #'>) highest))))))) diff -r 5f6c2d777533 -r d692b61fbee1 src/2018/days/day-03.lisp --- a/src/2018/days/day-03.lisp Sun Dec 08 13:47:53 2019 -0500 +++ b/src/2018/days/day-03.lisp Sun Dec 08 14:50:54 2019 -0500 @@ -40,5 +40,5 @@ (values (iterate (for uses :in-array fabric) (counting (> uses 1))) - (claim-id (first (unique claims :test #'claims-intersect-p)))))) + (id (first (unique claims :test #'claims-intersect-p))))))