Trying to generate random random numbers!

Jonathan I. Kamens jik at athena.mit.edu
Mon Mar 18 15:40:12 AEST 1991


In article <7161 at bgsuvax.UUCP>, sapienza at bgsuvax.UUCP (Michael A. Sapienza) writes:
|> I could use some help in generating random numbers.  The problem I am having
|> is that I get the same set of numbers each time that I run the program.  I
|> have tried using srandom (seed) and entering the seed from the keyboard,
|> but this also returns the same random number.  Any help would be greatly
|> appreciated!

  I have no problem at all using srandom() and random() to get random numbers,
and I expect most of the other readers of this newsgroup have no problem
either, so it's really impossible for us to diagnose the problem you are
having unless you tell us more specifically exactly what your code is doing. 
For example, it would help if you would provide a short test program that
doesn't work (i.e. gets the same random numbers each time) for you.

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710



More information about the Comp.unix.programmer mailing list