so you can fiddle with the sum, and the number of elements you want at your leisure.my $sum = 100; my $elements = 30; my @array; for (1..$sum) { ++$array[ int rand $elements ]; } $array[$_] ||= 0 for @array;
In reply to Re: Randomly generating histograms
by Jasper
in thread Randomly generating histograms
by narse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |