Path: utzoo!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.programmer Subject: Re: Trying to generate random random numbers! Message-ID: <1991Mar18.054012.24970@athena.mit.edu> Date: 18 Mar 91 05:40:12 GMT References: <7161@bgsuvax.UUCP> Sender: news@athena.mit.edu (News system) Organization: Massachusetts Institute of Technology Lines: 19 In article <7161@bgsuvax.UUCP>, sapienza@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@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710