I'm working with Swift in Ubuntu, and I am getting an error that arc4random is an unresolved identifier. More information on this known bug here. Basically, the function only exists in BSD distros. I've tried module mapping header files, apt-getting packages, and I get more and more errors, which is not worth pursuing since this one function is not used very often.
Are there any functions to get pseudo random numbers with an upper-bound parameter that is compatible with Swift in Linux?
Swift 4.2
let random = Int.random(in: 0...100)
https://developer.apple.com/documentation/swift/int/2995648-random
PS. It works in Linux.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With