Created
April 26, 2015 10:08
-
-
Save MartinJNash/6be73df9d73fde6917e9 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
func randBetween(range: Range<Int>) -> Int { | |
let num = arc4random_uniform(UInt32(range.endIndex + 1)) | |
return Int(num) + range.startIndex | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment