rename var

This commit is contained in:
Adam Jeniski 2025-12-08 22:18:16 -10:00
parent 37c2786336
commit 055a37a089

View File

@ -7,7 +7,7 @@
(defn area [[ax ay] [bx by]] (defn area [[ax ay] [bx by]]
(* (inc (abs (- ax bx))) (* (inc (abs (- ax bx)))
(inc (abs (- ay by))))) (inc (abs (- ay by)))))
(def furthest-points (def largest-squares
(->> (for [a input (->> (for [a input
b input b input
:when (not= a b)] :when (not= a b)]
@ -17,7 +17,7 @@
(sort-by #(apply area %)))) (sort-by #(apply area %))))
;; part 1 ;; part 1
(->> furthest-points (->> largest-squares
last last
(apply area)) (apply area))
@ -40,7 +40,7 @@
;; part 2 ;; part 2
(def line-segments (map vector input (conj (vec (rest input)) (first input)))) (def line-segments (map vector input (conj (vec (rest input)) (first input))))
(->> furthest-points (->> largest-squares
(filter (fn [[a b]] (filter (fn [[a b]]
(let [segments (filter (fn [[seg-a seg-b]] (and (not= a seg-a) (let [segments (filter (fn [[seg-a seg-b]] (and (not= a seg-a)
(not= a seg-b) (not= a seg-b)