Created
January 3, 2016 16:13
-
-
Save viccc/9aced7bfda9b4cbdeb5a to your computer and use it in GitHub Desktop.
Revisions
-
viccc created this gist
Jan 3, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ func randomInt(range: Range<Int>) -> Int { let base = range.endIndex - range.startIndex let r = arc4random_uniform(UInt32(base)) let n = Int(r) + range.startIndex return n }