chore: testing
This commit is contained in:
parent
76b279a8a8
commit
29d2e90377
1 changed files with 13 additions and 6 deletions
|
|
@ -3,25 +3,32 @@
|
|||
|
||||
(defn is-even? [n]
|
||||
(if (= n 0)
|
||||
__
|
||||
(___ (is-even? (dec n)))))
|
||||
true
|
||||
(not (is-even? (dec n)))))
|
||||
|
||||
(defn is-even-bigint? [n]
|
||||
(loop [n n
|
||||
acc true]
|
||||
(if (= n 0)
|
||||
__
|
||||
acc
|
||||
(recur (dec n) (not acc)))))
|
||||
|
||||
(defn recursive-reverse [coll]
|
||||
__)
|
||||
(if (empty? coll)
|
||||
[]
|
||||
(conj (recursive-reverse (rest coll)) (first coll)))
|
||||
)
|
||||
|
||||
(defn factorial [n]
|
||||
__)
|
||||
(if (zero? n)
|
||||
1
|
||||
(if (false? (= c 1))
|
||||
)
|
||||
))
|
||||
|
||||
(meditations
|
||||
"Recursion ends with a base case"
|
||||
(= true (is-even? 0))
|
||||
(= true (is-even? 4))
|
||||
|
||||
"And starts by moving toward that base case"
|
||||
(= false (is-even? 1))
|
||||
|
|
|
|||
Loading…
Reference in a new issue