Created
August 20, 2010 14:57
-
-
Save anonymous/540490 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 c-rand-int | |
"Returns a random int >= lower and <= upper, that doesn't equal forbid" | |
[lower upper forbid] | |
(if-not (= (def rval (+ (rand-int (+ upper 1)) lower)) forbid) | |
rval | |
(c-rand-int lower upper forbid))) | |
(println (c-rand-int 0 7 2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment