From 8d43e37df99f280377bed90284d6ac2428334804 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Wed, 30 Nov 2022 19:55:31 -0500 Subject: move 2021 days to folder; update README --- day10/part1.clj | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 day10/part1.clj (limited to 'day10/part1.clj') diff --git a/day10/part1.clj b/day10/part1.clj deleted file mode 100644 index 60ed1e6..0000000 --- a/day10/part1.clj +++ /dev/null @@ -1,22 +0,0 @@ -(def to-closing {\{ \} \( \) \[ \] \< \>}) -(def to-score {\) 3 \] 57 \} 1197 \> 25137}) - -(defn check-line [input] - (loop [in input open '()] - (when-let [c (first in)] - (if (some->> (#{\} \) \] \>} c) (not= (first open))) - c - (recur - (rest in) - (if-let [op (to-closing c)] - (conj open op) - (rest open) - )))))) - -(->> (slurp "./in") - (clojure.string/split-lines) - (map (comp to-score check-line vec)) - (filter some?) - (apply +) - (println)) - -- cgit v1.2.3