Created
December 3, 2020 16:15
-
-
Save stuartstein777/b9e34125f48d3c7791c2e08e7c41e576 to your computer and use it in GitHub Desktop.
advent-of-code-2020-day3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn is-tree [x i] | |
(= \# (nth i (mod x (count i))))) | |
(let [input (->> (slurp "input.txt") | |
(str/split-lines)) | |
x-step 7 | |
y-step 1] | |
(->> (take-nth y-step input) | |
(map is-tree (iterate #(+ x-step %) 0)) | |
(filter true?) | |
(count))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment