Newsgroups: comp.os.msdos.djgpp Date: Fri, 22 Aug 1997 13:55:46 -0700 From: Daniel Koepke Subject: Re: Random numbers... In-Reply-To: <5tepnq$2h5$1@news.kode.net> Message-ID: References: <01bcaa71$4c08c200$0d5e4ec2 AT xyy> <5telqi$1ue$1 AT news DOT kode DOT net> <5tepnq$2h5$1 AT news DOT kode DOT net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII NNTP-Posting-Host: 140.174.210.7 Lines: 31 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On 20 Aug 1997, Heathen wrote: -+ #include -+ -+ main(){ -+ int C; -+ struct time time_struct; -+ gettime(&time_struct); -+ C = time_struct.ti_hund; -+ printf("%d",time_struct.ti_hund); -+ } Or, you could... #include #define RAND(min,max) ((random() % (max-min+1))+min) void main() { srand(time(0)); printf("A random between 1-1000: %d\n", RAND(1,1000)); } Not the best of the best of the pseudo-random number generators, but not terrible. -- Daniel Koepke -:- dkoepke AT california DOT com -:- [Shadowlord/Nether] Think.