⭐ in reply to How do I get random numbers that follow standard distribution?
How about something like this:
You can vary the number of iterations (1..5) and scaling factor (20) based on the exact distribution curve you want.sub f{ my $t=0; $t+=rand() for(1..5); return int($t*20+1); }
There are several other ways to approach this problem. If efficiency were of paramount importance, I would try using statistical method to derive a function that would aproximate the curve of how in frequency you would map numbers from 0 to 0.9999 (the range of perl's rand function) into the range you want (1 to 100).
In Section
Seekers of Perl Wisdom