As a fun project, I'm developing a cricket simulator game and one of the main aspects of it is to have a random outcome on each delivery bowled.
In general, in Test Cricket, the possibility is as follows:
"0", "1" happen very frequently (60% of the time)
"2", "3" happen moderately (25% of the the time)
"FOUR", "SIX", "OUT" happen rarely (10% of the time)
"WIDE BALL", "NO BALL" happen very rarely (2% of the time)
If I have an array such as:
var possible_outcomes = ["0","1","2","3","FOUR","SIX","OUT","WIDE BALL","NO BALL"];
What could be the best way to get the above mentioned probability when pulling a random item from possible_outcomes
over a fixed number of iterations, say 60.
PS: I'm sorry if some of you are unaware of the sport. I've used a couple of terms related to Cricket since I didn't know how to explain any better.