From 1041984da04df8d2968e3b45fd70beedd7b3ba8b Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 27 Jun 2023 21:00:04 +0100 Subject: (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. --- 2022/puzzle-5.lisp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '2022/puzzle-5.lisp') 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) -- cgit v1.2.3-13-gbd6f