From: "Nathan Cournia" Newsgroups: comp.os.msdos.djgpp Subject: Random interger numbers Date: 24 Mar 1998 04:31:32 GMT Organization: Middle Tennessee State University Lines: 11 Message-ID: <01bd56dd$5d636c80$0f02000a@frank.mtsu.edu.frank.mtsu.edu> NNTP-Posting-Host: knuth.mtsu.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk How do I produce a random interger number between 0 and n. Right now I'm using the following code: return (((int)((double)rand()/(double)RAND_MAX))*n); Unfortunately this equation always produces the result of 0. What I need is a function that will act as a (n) sided dice. Thanks for the help. Nathan of bringing the cursor to the >appropriate line of the appropriate file, Rhide seems to choose an >arbitrary line in the file to jump to. Then if I keep pressing F7/F8 it >moves the cursor down, but it has already started from the wrong place. Have you modified the source file since you've rebuilt? Try recompiling that file and re-linking your exe. Andy