Last active
July 15, 2016 03:12
-
-
Save lagenorhynque/6e65d8f2d9f1538bd0370bc8c2ac2d57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn my-odd? [n] | |
(letfn [(odd?? [n] | |
(if (zero? n) | |
false | |
#(even?? (dec n)))) | |
(even?? [n] | |
(if (zero? n) | |
true | |
#(odd?? (dec n))))] | |
(trampoline odd?? n))) | |
(do (println (my-odd? 10)) | |
(println (my-odd? 100)) | |
(println (my-odd? 1000)) | |
(println (my-odd? 10000)) | |
(println (my-odd? 100000))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment