What's the best way to produce a weighted die roll in Swift, given the following percentages?
var weight = [0.1, 0.2, 0.2, 0.3, 0.1, 0.1]
e.g. There's a 10% chance it will roll a 1, 20% chance for a 2, etc.
What's the best way to produce a weighted die roll in Swift, given the following percentages?
var weight = [0.1, 0.2, 0.2, 0.3, 0.1, 0.1]
e.g. There's a 10% chance it will roll a 1, 20% chance for a 2, etc.