Update 08_conditionals.clj

This commit is contained in:
Alex Gorelov 2018-03-15 16:35:57 +03:00 committed by GitHub
parent a5456c9d6a
commit b27012e574
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,39 +9,39 @@
"is that even exercise?")) "is that even exercise?"))
(meditations (meditations
"You will face many decisions" "Нужно принимать решения"
(= __ (if (false? (= 4 5)) (= __ (if (false? (= 4 5))
:a :a
:b)) :b))
"Some of them leave you no alternative" "Иногда альтернативы нет"
(= __ (if (> 4 3) (= __ (if (> 4 3)
[])) []))
"And in such a situation you may have nothing" "И вы ничего не получаете"
(= __ (if (nil? 0) (= __ (if (nil? 0)
[:a :b :c])) [:a :b :c]))
"In others your alternative may be interesting" "Иногда выбор есть"
(= :glory (if (not (empty? ())) (= :glory (if (not (empty? ()))
:doom :doom
__)) __))
"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 __) :road-not-taken
(= x __) :another-road-not-taken (= x __) :another-road-not-taken
:else __))) :else __)))
"Or your fate may be sealed" "Получаем doom"
(= 'doom (if-not (zero? __) (= 'doom (if-not (zero? __)
'doom 'doom
'more-doom)) 'more-doom))
"In case of emergency, go fast" "Выбирать можно и так"
(= "pretty fast" (= "pretty fast"
(explain-exercise-velocity __)) (explain-exercise-velocity __))
"But admit it when you don't know what to do" "Можно задавать ответ по-умолчанию"
(= __ (= __
(explain-exercise-velocity :watching-tv))) (explain-exercise-velocity :watching-tv)))