fix orderings to match comment better

This commit is contained in:
Adam Jeniski 2025-12-29 08:46:51 -05:00
parent 5a1773ca77
commit e851c41935

View File

@ -1,5 +1,5 @@
(ns day09
(:require input-manager))
(:require [input-manager]))
(def input (->> (input-manager/get-input 2025 9)
(mapv #(mapv parse-long (re-seq #"\d+" %)))))
@ -28,10 +28,10 @@
"Lines AB and CD intersect if points A and B falls on different sides of CD
and if C and D fall on different sides of AB"
[[a b] [c d]]
(let [o1 (orientation a b c)
o2 (orientation a b d)
o3 (orientation c d a)
o4 (orientation c d b)]
(let [o1 (orientation a c b)
o2 (orientation a d b)
o3 (orientation c a d)
o4 (orientation c b d)]
(and (not= o1 o2) (not= o3 o4))))
(def line-segments (map vector input (rest input)))
@ -49,4 +49,3 @@
(map (partial apply area))
sort
last)