Created
February 10, 2017 16:27
-
-
Save jay18001/f2a6c80860d9188b0e7ceb838bd7a726 to your computer and use it in GitHub Desktop.
Script to generate a random number
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 characters
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