Quote:
> > Does anyone know how to increase the variables of the INT(RND* #) -#
> > What I mean is I need the randomize timer to produce numbers from 1 to
> > something like 1000. Please help. For Qbasic.
> > --
> > ~Lamaal Brown http://www.earthlink.net/~brown5/tlbsite
> With UB=<upper boundary> (=1000) and LB=<lower boundary> (=1) the
> formula is: RandNoBetweenLBandUB = (UB - LB + 1)*RND + LB
> To get integer-numbers use the INT()-function.
Enno is correct, and gives the general formula. When generating pseudo
random integers from 1 to N the general formula can be reduced to:
RandomInteger = INT(RND * N) + 1
So the original poster can get random integers from 1 to 1000 by using:
RandomInteger = INT(RND * 1000) + 1
--
Judson McClendon This is a faithful saying and worthy of all
Sun Valley Systems acceptance, that Christ Jesus came into the
(please remove zzz from email id to respond)