We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent addfb7f commit c90db9bCopy full SHA for c90db9b
src/xkcd_936/core.clj
@@ -46,6 +46,7 @@
46
47
(defn randomWordFromOptions [words options]
48
(let [randomWord (string/join \space (take 1 (secureShuffle words)))]
49
+ (remove randomWord words)
50
(cond
51
(and (>= (count randomWord) (:lte options)) (<= (count randomWord) (:gte options))) randomWord
52
:else (randomWordFromOptions words options))))
@@ -66,6 +67,7 @@
66
67
(let [{:keys [options arguments errors summary]} (parse-opts args cli-options)]
68
69
(:help options) (exit 0 summary)
70
+ (> (:lte options) (:gte options)) (exit 0 "Minimum Characters (-l) should be greater than Maximum Characters (-g)")
71
errors (exit 1 errors))
72
(let [wordList (lines fileName)]
73
(loop [i 0]
0 commit comments