add new libary functions aoc-clj
This commit is contained in:
parent
cf4603617c
commit
6f630a68e6
|
@ -7,3 +7,19 @@
|
|||
io/resource
|
||||
io/reader
|
||||
line-seq))
|
||||
|
||||
(defn two-part-input [year day]
|
||||
(let [input (read-lines year day)
|
||||
empty-line? #(= "" %)]
|
||||
[(vec (take-while empty-line? input))
|
||||
(vec (rest (drop-while empty-line? input)))]))
|
||||
|
||||
(defn two-part-input [year day]
|
||||
(let [input (read-lines year day)
|
||||
two-parts (split-at (count (take-while #(not= "" %) input))
|
||||
input)]
|
||||
[(vec (first two-parts))
|
||||
(vec (rest (second two-parts)))]))
|
||||
|
||||
(defn input-line [year day]
|
||||
(first (aoc/read-lines year day)))
|
||||
|
|
Loading…
Reference in New Issue