From: Lyle Newsgroups: comp.os.msdos.djgpp Subject: Re: random number? Date: Sat, 16 Aug 1997 15:19:54 +1000 Organization: Monash Uni Lines: 31 Message-ID: <33F5387A.E6072453@NO_SPAMccds.cc.monash.edu> References: <33F3CA35 DOT 29B3 AT erols DOT com> NNTP-Posting-Host: ascend-2-34.cc.monash.edu.au Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Matt McFadden wrote: > > Hi, > > How can I make a loop that returns or produces a random integer between > 0-9 on each pass through the loop? > > Thank you, > Matt hi, whatever generates your random number, mod it; ie random_number() % 10 this then returns the 'remainder of dividing by ten" which can only be 0-9 cya -- NOTE: Remove The comment "NO_SPAM" To Reply via Email! -------------------------------[ **NEW ADDRESS** lpak1 AT ccds DOT cc DOT monash DOT edu DOT au] " Hello Chevra Kadish, You Kill 'em, We Chill 'em " .----, | oO | HTTP://www-personal.monash.edu.au/~lpak1/ | \/ | `----'