Merge pull request #8 from HantonSacu/HantonSacu-08

Solve conditionals
This commit is contained in:
Kenneth Kostrešević 2021-12-16 16:03:14 +01:00 committed by GitHub
commit 67bd221aa1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,38 +10,38 @@
(meditations (meditations
"You will face many decisions" "You will face many decisions"
(= __ (if (false? (= 4 5)) (= :a (if (false? (= 4 5))
:a :a
:b)) :b))
"Some of them leave you no alternative" "Some of them leave you no alternative"
(= __ (if (> 4 3) (= [] (if (> 4 3)
[])) []))
"And in such a situation you may have nothing" "And in such a situation you may have nothing"
(= __ (if (nil? 0) (= nil (if (nil? 0)
[:a :b :c])) [:a :b :c]))
"In others your alternative may be interesting" "In others your alternative may be interesting"
(= :glory (if (not (empty? ())) (= :glory (if (not (empty? ()))
:doom :doom
__)) :glory))
"You may have a multitude of possible paths" "You may have a multitude of possible paths"
(let [x 5] (let [x 5]
(= :your-road (cond (= x __) :road-not-taken (= :your-road (cond (= x 3) :road-not-taken
(= x __) :another-road-not-taken (= x 4) :another-road-not-taken
:else __))) :else :your-road)))
"Or your fate may be sealed" "Or your fate may be sealed"
(= 'doom (if-not (zero? __) (= 'doom (if-not (zero? 1)
'doom 'doom
'more-doom)) 'more-doom))
"In case of emergency, go fast" "In case of emergency, go fast"
(= "pretty fast" (= "pretty fast"
(explain-exercise-velocity __)) (explain-exercise-velocity :bicycling))
"But admit it when you don't know what to do" "But admit it when you don't know what to do"
(= __ (= "is that even exercise?"
(explain-exercise-velocity :watching-tv))) (explain-exercise-velocity :watching-tv)))