Basically, I know how to get a random number but I'm not sure how to select an item from a list which has a percentage of being randomly selected.
EG. If this is my list
Red - 10%
Blue - 25%
Green - 7%
Yellow - 58%
I then declare a random which selects an item based off their percentage. So yellow is likely to be selected and green the least likely.
How would I go around doing that.
EG. If this is my list
Red - 10%
Blue - 25%
Green - 7%
Yellow - 58%
I then declare a random which selects an item based off their percentage. So yellow is likely to be selected and green the least likely.
How would I go around doing that.