clojure-koans/src/koans/07_conditionals.clj
Colin Jones 78c5704f34 Rename to use underscores instead of dashes
Works fine either way - this is just since underscores are required
in filenames for real projects, so it's something good for folks to
get used to.
2012-06-08 15:22:42 -05:00

47 lines
1.2 KiB
Clojure

(defn explain-defcon-level [exercise-term]
(case exercise-term
:fade-out :you-and-what-army
:double-take :call-me-when-its-important
:round-house :o-rly
:fast-pace :thats-pretty-bad
:cocked-pistol :sirens
:say-what?))
(meditations
"You will face many decisions"
(= __ (if (false? (= 4 5))
:a
:b))
"Some of them leave you no alternative"
(= __ (if (> 4 3)
[]))
"And in such a situation you may have nothing"
(= __ (if (nil? 0)
[:a :b :c]))
"In others your alternative may be interesting"
(= :glory (if (not (empty? ()))
:doom
__))
"You may have a multitude of possible paths"
(let [x 5]
(= :your-road (cond (= x __) :road-not-taken
(= x __) :another-road-not-taken
:else __)))
"Or your fate may be sealed"
(= __ (if-not (zero? __)
'doom
'doom))
"In case of emergency, sound the alarms"
(= :sirens
(explain-defcon-level __))
"But admit it when you don't know what to do"
(= __
(explain-defcon-level :yo-mama)))