Hi. Actually, it's not that smart to use % for such small values like that. The least significant bits of the random number are really not very random at all. Instead you may want to use:
((SysRandom(0) >> 8) % 15) + 1 Laurence Mee. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Fergal Moran Sent: 13 December 2001 15:15 To: Palm Developer Forum Subject: RE: andom number from 1 to 15 > From: Stringer [mailto:[EMAIL PROTECTED]] > >From: Johnathan Smith <[EMAIL PROTECTED]> > >Can someone please show me how to make a random number > >from 1 to 15 > > 6 Yup - it's a good one! SysRandom will generate a random number - simply modulus it with upperbound+1 to get a number in your range. (SysRandom(seed)%15)+1 -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
