Stefan Johnson wrote:

> I know some people may complain and say I don't know what
> I'm talking about, but I read somewhere recently (while
> working on a dice function for my IRC bot) that "srand"
> is no longer necessary.  You might try removing that line
> from your code and see what errors you get (I doubt it
> will fix the problem, as it quit working before on a
> system that it used to work on) but it might generate
> an error.  I wish I could be more help.  Good luck.
> Respectfully,
> Stefan

Hi Stefan,

It probably is no longer necessary to call srand explicitly, but if it isn't happening 
somewhere in the background, then the results will be exactly what Gaz is seeing.  
Since any algorithm is a predefined set of steps, an algorithm will always produce the 
same series of results unless some randmizing mechansim is used to seed the algorithm. 
 Traditionally, this has been to use the time function to generate the seed.

If anyone can point me to way that an algorithm can produce varying outputs without 
some unpredictable input, I would be interested in hearing.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to