[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Getting randomic integers
- From: Majic <majic.one@...>
- Date: Sun, 17 Jan 2010 00:31:07 -0800
But if you're executing the script, in it's entirely, more than once a
second you're randomseed()'ing with the same time in that second and
you'll get the same random numbers...
On Sun, Jan 17, 2010 at 12:23 AM, Alex Davies <alex.mania@iinet.net.au> wrote:
> Majic wrote:
>>
>> Yes yes, was just hoping to get random numbers more than once a second
>> :) I don't think that's portable though.... oh well.
>
> Easy ;). Call randomseed once, when your program is first loaded... and
> then call random whenever you need a new number. There's no need to call
> randomseed more then once.
>
> - Alex
>