Fix day10pt1 and add correct day10pt2
[adventofcode2019.git] / src / adventofcode2019 / lib.clj
index 2699439f649085f7769e1b9154858ebd8e09f7d9..d992475caf866b9d7f992668c6bba59ec390ab53 100644 (file)
   (let [bottom-ns (last (str/split (str *ns*) #"\."))]
     (str "resources/" bottom-ns)))
 
+(defn manhattan-distance [[ax ay] [bx by]] 
+  (+ (Math/abs (- ax bx))
+     (Math/abs (- ay by))))
+
 (def part1 
   #(println (str "Part 1: " %)))
 (def part2