My question is pretty basic: how can I make arc4random_uniform
return a random value between 1.75 and 2.25?
This code below is only returning me Int
values.
import SpriteKit
let duration = CGFloat((arc4random_uniform(50)+175)/100) //random between 1.75 and 2.25 attempt
print("Duration:", duration)
If you want, you can download the playground file here.
Thanks in advance,
Luiz.