Created
March 30, 2014 02:10
-
-
Save yokolet/9866286 to your computer and use it in GitHub Desktop.
Recursive call functions used from trampoline - for ClojureBridge CommunityDocs
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
(declare incrementor2 decrementor2) | |
(defn incrementor2 [n] | |
(let [_ (print (str n ", ")) | |
next-val (+ n (rand-int 100))] | |
(if (< -10000 next-val) | |
#(decrementor2 next-val)))) | |
(defn decrementor2 [n] | |
(let [_ (print (str n ", ")) | |
next-val (- n (rand-int 100))] | |
(if (> 10000 next-val) | |
#(incrementor2 next-val)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment