delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/26/09:18:56

From: ah897 AT detroit DOT freenet DOT org (Heathen)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Random numbers...
Date: 20 Aug 1997 12:59:38 GMT
Organization: C-Rad
Lines: 34
Message-ID: <5tepnq$2h5$1@news.kode.net>
References: <01bcaa71$4c08c200$0d5e4ec2 AT xyy> <5telqi$1ue$1 AT news DOT kode DOT net>
NNTP-Posting-Host: ppp-425.kode.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <5telqi$1ue$1 AT news DOT kode DOT net>, ah897 AT detroit DOT freenet DOT org says...
>
>In article <01bcaa71$4c08c200$0d5e4ec2 AT xyy>, xyy AT infonie DOT be says...
>>
>>
>>Hi!
>>
>>
>>I still can't obtain truly random numbers with the srand(), random(), and
>>rand() functions, because, whatever the seed number i put in srand(), it is
>>_always the same results.
>>


In my Previous Post I demonstrated PSEUDO - CODE for a RANDOM Numbers Generator.
Here's the actual code.  You can cut paste it and it'll run in Borland or DJGPP/ALLEGRO! 
I just compiled it in RHIDE.  

             #include <dos.h>

             main(){
             int C;
             struct time time_struct;
             gettime(&time_struct);
             C = time_struct.ti_hund;
             printf("%d",time_struct.ti_hund);


             }

That's all there is to it! 1 - 100 Random Number generator!

                                                   HEATHEN!!!

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019