Not being a native speaker, how would you call a class that returns one of given values with a given probability?
The usage might be like this:
(If I knew how it might be called, may-be I could find an existing one on the Internet )Code:.... random_number_picker({'a':10, 'b':8, 'c':4, 'd':6}); random_number_picker.get(); //returns 'a' with probability 10/28, 'b' - 8/28 etc