rand-int returns a pseudorandom integer below a supplied integer bound. It requires one argument, produces an integer, and uses Clojure’s Java-backed pseudorandom generation; this is suitable for many practical uses, but not stronger randomness requirements. section 5.10
Generate a bounded integer
(rand-int 10) ;; 0 through 9 (rand-int -10) ;; -5 The bound must be an integer; rand-int has no zero-argument form. The negative-bound example demonstrates that negative bounds are accepted, while the exact result remains unpredictable. section 5.10
Use rand-int when the random number itself matters, especially when it will control an index. For selecting an element from a collection, rand-nth packages the same idea; use rand-int with nth when explicit index control is useful. section 8.3.1
