NAME

irand - return a random number within a specified range


SYNOPSIS

value = irand(minimum, maximum)


DESCRIPTION

Call irand to get a random number that falls within the range specified by the arguments.

It's a good idea to call srand once to seed the random number generator before using irand. Otherwise, a seed of 1 will be used.


ARGUMENTS

minimum, maximum
These mandatory arguments define the range within which falls the random value returned by irand.


RETURNS

A random number between minimum and maximum, inclusive.


EXAMPLES

   srand(0)
   min = -30
   max = 10
   for (i = 0; i < 20; i = i + 1) {
      randval = irand(min, max)
      print(randval)
   }

prints 20 random numbers having values between -30 and 10, inclusive.


SEE ALSO

srand, random, rand, pickrand, pickwrand, spray_init, get_spray, gen20