Skip to content

Commit

Permalink
Use DOSEQS instead of LOOP
Browse files Browse the repository at this point in the history
  • Loading branch information
iamFIREcracker committed Jan 28, 2024
1 parent 7b76b9b commit 4575875
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/2023/day09.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
(in-package :aoc/2023/09)


(defun parse-input (&optional (strings (uiop:read-file-lines #P"src/2023/day09.txt")))
(defun parse-input (&optional (strings (aoc::read-problem-input 2023 09)))
(mapcar #'extract-integers strings))


(defun deltas (nums)
(loop for n in nums by #'cdr for m in (cdr nums) by #'cdr
collect (- m n)))
(looping
(doseqs ((n nums)
(m (cdr nums)))
(collect! (- m n)))))


(defun prediction-sequences (history)
(looping
Expand Down

0 comments on commit 4575875

Please sign in to comment.