From 2e19753b65388d06728b772e78cfbbb88e69d96d Mon Sep 17 00:00:00 2001 From: Alan Daniels Date: Sat, 6 Dec 2025 16:56:05 +1100 Subject: [PATCH] fmt --- 02a.lisp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/02a.lisp b/02a.lisp index abf5fc0..caa20cd 100644 --- a/02a.lisp +++ b/02a.lisp @@ -4,18 +4,14 @@ (defun get-range (range) (let ((range (str:split "-" range))) - (loop for i from (parse-integer (car range)) to (parse-integer (car (cdr range))) collect i) - ) - ) + (loop for i from (parse-integer (car range)) to (parse-integer (car (cdr range))) collect i))) (get-range "11-22") (defun get-ranges (instr) (loop for range in (str:split "," (string-trim '(#\Newline) instr)) collect - (get-range range) - ) - ) + (get-range range))) (get-ranges "1-3,4-5") (defun validate-product-id (product-id) @@ -25,10 +21,7 @@ ;(print product-id) (cond ((not (evenp product-id-length)) t) - (t (not (string= (subseq product-id 0 split-at) (subseq product-id split-at)))) - ) - ) - ) + (t (not (string= (subseq product-id 0 split-at) (subseq product-id split-at))))))) (validate-product-id 1212) (validate-product-id 123) (validate-product-id 1234) @@ -37,11 +30,7 @@ (reduce #'+ (remove-if #'validate-product-id (reduce #'append - (get-ranges text) - ) - ) - ) - ) + (get-ranges text))))) (sum-all-invalid-ids (uiop:read-file-string "02example.txt")) (sum-all-invalid-ids (uiop:read-file-string "02data.txt"))