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 --- day22/part1.clj | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 day22/part1.clj (limited to 'day22/part1.clj') diff --git a/day22/part1.clj b/day22/part1.clj deleted file mode 100644 index bffc1a9..0000000 --- a/day22/part1.clj +++ /dev/null @@ -1,25 +0,0 @@ -(require '[clojure.string :as str]) - -(def input (->> (slurp "./in") - (str/split-lines) - (map - (fn [line] - [(if (str/starts-with? line "on") true false) - (->> (str/split line #"[^-\d]+") - (rest) - (map #(Integer/parseInt %)) - (partition 2))])))) - -(println - (frequencies - (vals - (reduce - (fn [cmap c] - (into cmap - (let [[xx yy zz] (second c)] - (for [x (range (max -50 (first xx)) (inc (min 50 (second xx)))) - y (range (max -50 (first yy)) (inc (min 50 (second yy)))) - z (range (max -50 (first zz)) (inc (min 50 (second zz))))] - [[x y z] (first c)])))) - {} input)))) - -- cgit v1.2.3