in reply to Re: Randomly generating histograms
in thread Randomly generating histograms

This is similar to the method I am using at the moment for testing. The problem I have is the first entries in the array always have the largest numbers, while the last ones are nearly always 0. I mixed this up some by randomizing which array index each value goes into but I'm hoping to find something thats a little more random. Thanks tho.

Replies are listed 'Best First'.
Re: Re: Re: Randomly generating histograms
by derby (Abbot) on Mar 25, 2002 at 16:56 UTC
    This is completely hackish but loop for x number of times (12, 100?) before using the values of rand:

    $x = int rand( 100 ) for ( 1 .. 12 ); $x = 0;

    update: Or better yet. After you have the array filled, shuffle it as described in perlfaq4. -derby