Message-ID: <35662A33.9EB0FE7D@uol.com.br> Date: Fri, 22 May 1998 22:45:23 -0300 From: "Juciê Dias Andrade" MIME-Version: 1.0 To: Jason Cain CC: djgpp AT delorie DOT com Subject: Re: Random numbers in a certain range? References: <3565ED8E DOT 18DE01B6 AT SPAM DOT ti DOT com DOT SUCKS> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Jason Cain escreveu: > > Hello, > > I'm trying to find a way to generate random numbers within a given > range. I want to generate a series of random points to draw on the > screen, and so in my case I need to generate random numbers from 0...640 > and 0...480. That's easy: rand() % 480 will fall betwen 0 and 479 rand() % 640 will fall betwen 0 and 639. I hope it helps. []s