X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Trace-PostClient-IP: 68.147.225.57 From: Brian Inglis Newsgroups: comp.os.msdos.djgpp Subject: Re: random() : What am I doing wrong? Organization: Systematic Software Message-ID: References: <13drciokqdoav65 AT corp DOT supernews DOT com> <200709041948 DOT l84JmRfh001331 AT envy DOT delorie DOT com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 16 Date: Thu, 06 Sep 2007 12:27:15 GMT NNTP-Posting-Host: 64.59.135.176 X-Complaints-To: abuse AT shaw DOT ca X-Trace: pd7urf1no 1189081635 64.59.135.176 (Thu, 06 Sep 2007 06:27:15 MDT) NNTP-Posting-Date: Thu, 06 Sep 2007 06:27:15 MDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Tue, 4 Sep 2007 15:48:27 -0400 in comp.os.msdos.djgpp, DJ Delorie wrote: > >> What about if I want to generate numbers in the range of 1 through 50? >> How do I specify my range? > >Take the result and "% 50". (x % 49) + 1; % => 0..49; + => 1..50 -- Thanks. Take care, Brian Inglis Calgary, Alberta, Canada Brian DOT Inglis AT CSi DOT com (Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca) fake address use address above to reply