in reply to Randomly generating histograms
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Randomly generating histograms
by particle (Vicar) on Mar 25, 2002 at 19:14 UTC | |
by merlyn (Sage) on Mar 26, 2002 at 22:24 UTC | |
by particle (Vicar) on Mar 27, 2002 at 00:45 UTC |