Commit | Line | Data |
---|---|---|
cca08f5d JK |
1 | (ns adventofcode2019.lib |
2 | [:require [clojure.string :as str] | |
3 | [clojure.java.io :as io]]) | |
4 | ||
5 | (defn get-list-from-file | |
6 | ([file-name] | |
7 | (str/split-lines (str/trim (slurp file-name)))) | |
8 | ([file-name split-regex] | |
9 | (str/split (str/trim (slurp file-name)) split-regex))) | |
10 | ||
11 | (defmacro input-file [] | |
12 | (let [bottom-ns (last (str/split (str *ns*) #"\."))] | |
13 | (str "resources/" bottom-ns))) | |
14 | ||
15 | (def parse-int | |
16 | #(Integer/parseInt %)) |