fix orderings to match comment better
This commit is contained in:
parent
5a1773ca77
commit
e851c41935
@ -1,5 +1,5 @@
|
|||||||
(ns day09
|
(ns day09
|
||||||
(:require input-manager))
|
(:require [input-manager]))
|
||||||
|
|
||||||
(def input (->> (input-manager/get-input 2025 9)
|
(def input (->> (input-manager/get-input 2025 9)
|
||||||
(mapv #(mapv parse-long (re-seq #"\d+" %)))))
|
(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
|
"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"
|
and if C and D fall on different sides of AB"
|
||||||
[[a b] [c d]]
|
[[a b] [c d]]
|
||||||
(let [o1 (orientation a b c)
|
(let [o1 (orientation a c b)
|
||||||
o2 (orientation a b d)
|
o2 (orientation a d b)
|
||||||
o3 (orientation c d a)
|
o3 (orientation c a d)
|
||||||
o4 (orientation c d b)]
|
o4 (orientation c b d)]
|
||||||
(and (not= o1 o2) (not= o3 o4))))
|
(and (not= o1 o2) (not= o3 o4))))
|
||||||
(def line-segments (map vector input (rest input)))
|
(def line-segments (map vector input (rest input)))
|
||||||
|
|
||||||
@ -49,4 +49,3 @@
|
|||||||
(map (partial apply area))
|
(map (partial apply area))
|
||||||
sort
|
sort
|
||||||
last)
|
last)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user