aboutsummaryrefslogtreecommitdiff
path: root/2022/puzzle-5.lisp
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-06-27 21:00:04 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-10-17 14:14:38 +0100
commit1041984da04df8d2968e3b45fd70beedd7b3ba8b (patch)
tree5d49d0c061589ddafb9fa5b9e8865343f2f82793 /2022/puzzle-5.lisp
parent3d8c64554157be723f555fc0dfb6652370e25316 (diff)
downloadadvent-of-code-1041984da04df8d2968e3b45fd70beedd7b3ba8b.tar.gz
advent-of-code-1041984da04df8d2968e3b45fd70beedd7b3ba8b.tar.bz2
advent-of-code-1041984da04df8d2968e3b45fd70beedd7b3ba8b.zip
(2022>README,1,5)+literate code for problem 1 rewrite,~minor changes to 5
Making README.org a literate document for my code to better describe my process.
Diffstat (limited to '2022/puzzle-5.lisp')
-rw-r--r--2022/puzzle-5.lisp3
1 files changed, 2 insertions, 1 deletions
diff --git a/2022/puzzle-5.lisp b/2022/puzzle-5.lisp
index 38c884e..70c6bb6 100644
--- a/2022/puzzle-5.lisp
+++ b/2022/puzzle-5.lisp
@@ -100,12 +100,13 @@ define this operation first! |#
(with-input-from-string (s instructions)
(loop
for line = (read-line s nil)
- until (null line)
+ while line
collect
;; Parse each instruction then move the crates!
(destructuring-bind (n a b) (parse-instruction-str line)
(move-crates n a b)))))
+;; The answer is simply the first top of each stack
(defun first-round ()
(setq state (default-state))
(parse-initial-state)