1 (ns adventofcode2019.day10
2 [:require [adventofcode2019.lib :refer :all]
3 [clojure.string :as str]
4 [clojure.core.match :refer [match]]
5 [clojure.math.combinatorics :as combo]])
8 (let [input (get-list-from-file (input-file))
10 (map-indexed (fn [i m]
11 (if (= \# m) [i j] nil)) l))
13 (map-indexed to-points)
17 to-slope (fn [[a-x a-y] [b-x b-y]]
23 find-visible (fn [ast]
24 (count (set (map (partial to-slope ast)
25 (disj asteroids ast)))))
26 visible-count (map #(vector % (find-visible %)) asteroids)]
27 (part1 (reduce (partial max-key second) visible-count))