Path: utzoo!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!rsiatl!meo From: meo@Dixie.Com (Miles ONeal) Newsgroups: comp.unix.programmer Subject: Re: Trying to generate random random numbers! Message-ID: <8325@rsiatl.Dixie.Com> Date: 18 Mar 91 05:06:43 GMT Organization: Systems & Software Solutions, Inc. Lines: 23 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! On what? Using what? Sounds like your srand() (srandom?) is broken. But the easy way (if srand() works) is to say srand ((int) time (0)); (assuming you are on a UNIX system). You might also check out the drand48() man page. -Miles Miles O'Neal meo@dixie.com {uunet | emory}!rsiatl!meo