~rauhl/advent-of-code

b33d3df91ce19ff6be6587cd3d82a398bbb7921d — Robert A. Uhl 1 year, 1 month ago ca430a1
Reformat lines to fit in 80 columns
1 files changed, 8 insertions(+), 2 deletions(-)

M 2018-12-01.lisp
M 2018-12-01.lisp => 2018-12-01.lisp +8 -2
@@ 1042,10 1042,16 @@
+113294
")

(format t "~&result: ~a~%" (with-input-from-string (s +input+) (loop for n = (read s nil) while n sum n)))
(format t "~&result: ~a~%"
        (with-input-from-string (s +input+)
          (loop for n = (read s nil) while n sum n)))

(format t "~&twice-visited: ~a"
        (let ((deltas (coerce (with-input-from-string (s +input+) (loop for n = (read s nil) while n collect n)) 'vector)))
        (let ((deltas (coerce (with-input-from-string (s +input+)
                                (loop for n = (read s nil)
                                      while n
                                      collect n))
                              'vector)))
          (loop with memo = (make-hash-table)
                for i from 0
                for n = (aref deltas (mod i (length deltas)))