From 5289e1dfdf6af5c70b0ae9a1eb9ea7453f698865 Mon Sep 17 00:00:00 2001 From: ajet Date: Fri, 5 Dec 2025 20:34:10 -1000 Subject: [PATCH] simplify --- 2025/src/day06.clj | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/2025/src/day06.clj b/2025/src/day06.clj index 8dd8100..c43e31e 100644 --- a/2025/src/day06.clj +++ b/2025/src/day06.clj @@ -6,14 +6,15 @@ (def num-line? (comp not #{\* \+} first)) (def nums-raw (take-while num-line? input)) -(def nums (->> nums-raw - (map #(map parse-long (re-seq #"\d+" %))))) +(def nums (map (comp (partial map parse-long) + #(re-seq #"\d+" %)) + nums-raw)) (def op-map {\+ +, \* *}) -(def ops (as-> input v - (drop-while num-line? v) - (first v) - (filter (partial not= \space) v) - (mapv op-map v))) +(def ops (->> input + (drop-while num-line?) + (first) + (filter (partial not= \space)) + (mapv op-map))) ;; part 1 (->> nums