Created
August 20, 2010 15:04
-
-
Save mrBliss/540504 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] | |
(let [rval (+ (rand-int (+ upper 1)) lower)] | |
(if (= forbid rval) | |
(recur lower upper forbid) | |
rval))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment