I would try initializing with TimGetTicks() and then calling with
SysRandom(0) for each subsequent call.  Also I would use

(long)SysRandom(0)*52/((long)sysRandomMax+1)

for a random number between 0 and 52.  The mod command takes the lower bits
of the returned random number, which tend to be weaker in passing random
number tests.

Oliver

At 08:25 AM 8/31/99 -0700, you wrote:
>Hi;
>I am using SysRandom to generate random numbers. It is really giving me fits
>in that I am not getting true random numbers. For one I am using it to
>shuffle cards. I see a flush very often with a pattern. Shuffling and
>dealing gives me the same hands over time way more than is natural.
>I have tried the following:
>
>SysRandom(0)%52
>SysRandom(TimGetSeconds())%52
>
>I have also tried using static vars to remember last rand num and use it as
>a seed. I am using GCC.
>Does anyone know a good way to make this more random? Any pointers
>appreciated (no pun intended :)
>-Jim.
>
>>---------------------------------------------------------
>> Jim Murff                         Voice # (619)679-7858
>> Engineering Project Manager       Fax   # (619)679-6966
>> [EMAIL PROTECTED]
>>
>>"For of all sad words of tongue or pen, the saddest are
>> these: It might have been."
>>---------------------------------------------------------
> 

Reply via email to