I have an array of names sorted in descending order by popularity, from John (at index 0) on down to Broderick (at index 1218). I need to choose one of the names randomly, but I want the more common names returned more often. So basically I need a function that returns numbers on a half-bell curve with lower numbers more often and higher numbers less often.
Dim names As String() = My.Resources.mnames.Split(vbCrLf) Dim x As integer Dim pick As String x = RandomHalfBell(UBound(names)) pick = names(x)
Something like that. So what does the RandomHalfBell function look like?