SUGGESTION: Minimum/Maximum random number (SOLVED)

Started by Kinoko, Wed 14/07/2004 15:31:27

Previous topic - Next topic

Kinoko

I'm playing around with the Random() function and in a lot of cases, it'd be  much easier for me if there were a minimum parameter as well as a maximum parameter. I'm not sure why there isn't already, is there an obvious work around? Or is it just much more difficult to build into the function? Just wondered :)


Radiant

function MyRandom (int min, int max) {
  return Random (max - min) + min;
}

Kinoko


SMF spam blocked by CleanTalk