Skip to content

Instantly share code, notes, and snippets.

@jay18001
Created February 10, 2017 16:27
Show Gist options
  • Save jay18001/f2a6c80860d9188b0e7ceb838bd7a726 to your computer and use it in GitHub Desktop.
Save jay18001/f2a6c80860d9188b0e7ceb838bd7a726 to your computer and use it in GitHub Desktop.
Script to generate a random number
import Foundation
let maxValue: UInt32
if CommandLine.arguments.count >= 2 {
maxValue = UInt32(CommandLine.arguments[1]) ?? 100
} else {
maxValue = 100
}
print(arc4random_uniform(maxValue))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment