From: Damian Yerrick Newsgroups: comp.os.msdos.djgpp Subject: Re: random number generator Organization: Pin Eight Software http://pineight.8m.com/ Message-ID: References: X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 22 X-Trace: /KtlGUj/39YbQVHgrszKfMhTnP+Ngk7iSqfvlBc5Xy8XcbhJsFrBbvossm/avXJtNJ5ICp6TksBJ!3oyH5BOaSIT4e0cCa/Tyn0dHClt2zmMLxvC7y8kqjbwtV/PclfEed5biPrr2ua0fWYAacVFq/Vz/!l8zmaQ== X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Fri, 10 Nov 2000 06:33:42 GMT Distribution: world Date: Fri, 10 Nov 2000 06:33:42 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Fri, 10 Nov 2000 01:41:58 GMT, "tritesnikov" wrote: >srand(time(0)); >a = rand() % 5; > >Error: implicit declaration of function 'int time(...)' 1. The dice formula is a = (rand() >> 4) % 6 + 1; This drops four extremely non-random low-order bits from the returned pseudorandom value, and then scales the rest between 1 and 6. 2. #include --