-
Notifications
You must be signed in to change notification settings - Fork 0
/
bb.edn
20 lines (20 loc) · 1.02 KB
/
bb.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{:paths ["."]
:tasks {:requires ([unwordle]
[babashka.fs :as fs]
[babashka.curl :as curl]
[clojure.java.io :as io]
[clojure.string :as str])
clean (do (fs/delete-tree (fs/parent (deref unwordle/file)))
(fs/delete unwordle/corpus-ref))
corpus (when-not (fs/exists? unwordle/file)
(println "no corpus found. fetching from: " unwordle/corpus-remote)
(io/copy (:body (curl/get unwordle/corpus-remote {:as :bytes}))
(io/file unwordle/file)))
strategy (get {"g" unwordle/global-freq-strategy
"p" unwordle/positional-freq-strategy}
(first *command-line-args*))
solve {:depends [corpus strategy]
:task (println (unwordle/solve strategy
(rest *command-line-args*)))}
auto {:depends [corpus]
:task (unwordle/play-random)}}}