I'm trying to use GKShuffledDistribution in one of my apps but the nextInt(upperBound:) method doesn't work the same as the nextInt method in that it doesn't exhaust all possible values. To demonstrate, open a playground and do this:
import GameplayKit
let shuffled = GKShuffledDistribution.init(lowestValue: 0, highestValue: 100)
for _ in 0...25{
shuffled.nextInt(upperBound: 100)
}
I got 2 duplicates using this method. If I replaced it with:
shuffled.nextInt()
I don't get any duplicates. Is this how nextInt(upperBound:) supposed to work? If it is, can some one point me to documentation explaining this? Thanks.