advent-23-clojure/src/utils.clj

12 lines
244 B
Clojure
Raw Normal View History

2024-11-09 03:59:33 +00:00
(ns utils)
(defn read-file
"Reads a file for advent of code."
([day] (slurp (str "./input/" day ".txt")))
([day test?] (slurp (str "./input" (if test? "_test/" "/") day ".txt"))))
2024-11-11 16:01:55 +00:00
(defn find-first
[f coll]
(first (filter f coll)))