-
Notifications
You must be signed in to change notification settings - Fork 0
/
aoc.clj
49 lines (43 loc) · 1.89 KB
/
aoc.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
(ns aoc
(:require [script.runner :as runner]
[script.generate :as generate]
[script.api :as api]
[script.util :as util]))
(defn run-solution [{:keys [input-dir auth-file year day]
:or {year (util/get-current-year)
day (util/get-current-day)}}]
(runner/run-solution (str auth-file)
(str input-dir)
(str year)
(str day)))
(defn bench-solution [{:keys [input-dir auth-file year day part]
:or {year (util/get-current-year)
day (util/get-current-day)}}]
(runner/bench-solution (str auth-file)
(str input-dir)
(str year)
(str day)
(str part)))
(defn run-tests [{:keys [year day]
:or {year (util/get-current-year)
day (util/get-current-day)}}]
(runner/run-tests (str year) (str day)))
(defn gen-new [{:keys [year day solution-template]
:or {solution-template "script/solution_template.clj"
year (util/get-current-year)
day (util/get-current-day)}}]
(generate/generate-solution (str solution-template)
(str year)
(str day)))
(defn get-input [{:keys [auth-file input-dir year day]
:or {year (util/get-current-year)
day (util/get-current-day)}}]
(api/download-input (str auth-file)
(str input-dir)
(str year)
(str day)))
(defn store-auth [{:keys [auth-file args]}]
(let [args (apply hash-map args)]
(api/store-auth (str auth-file)
(str (get args ":year" (util/get-current-year)))
(str (get args ":session")))))