This commit is contained in:
Adam Jeniski 2024-12-04 23:58:46 -05:00
parent 84fbe1a642
commit 774e85068b

View File

@ -9,8 +9,7 @@
(get (get input row) col)) (get (get input row) col))
;; part 1 ;; part 1
(->> input (->> (c/get-coords input)
c/get-coords
(map (fn [[row col]] (map (fn [[row col]]
(->> (for [offset (range 4)] (->> (for [offset (range 4)]
[[row (+ col offset)] [[row (+ col offset)]
@ -28,8 +27,7 @@
(reduce +)) (reduce +))
;; part 2 ;; part 2
(->> input (->> (c/get-coords input)
c/get-coords
(filter #(= (get-char %) \A)) (filter #(= (get-char %) \A))
(filter (fn [[row col]] (filter (fn [[row col]]
(->> [[[(dec row) (dec col)] [(inc row) (inc col)]] (->> [[[(dec row) (dec col)] [(inc row) (inc col)]]