#2

First, "random" generates a number between 0 and the number.
Random doesn't work with negative numbers.
And please, tell me what's the result of 1000-1500 ? It's -500.

Try this function to generate a random number contained in a range

PHP код:

stock randomEx
(minmax)
{
      if(
min max) return -1;
      return 
min random(max-min);

Reply


Messages In This Thread
huh? - by Stereotype - 30.06.2014, 20:12
Re : huh? - by S4t3K - 30.06.2014, 20:17
Re: huh? - by Stereotype - 30.06.2014, 20:22
Re : huh? - by S4t3K - 30.06.2014, 20:28
Re: huh? - by Stereotype - 30.06.2014, 20:42
Re: huh? - by xo - 30.06.2014, 20:44
Re : huh? - by S4t3K - 30.06.2014, 20:51
Re: huh? - by xo - 30.06.2014, 20:53
Re : huh? - by S4t3K - 30.06.2014, 20:55
Re: Re : huh? - by Stereotype - 30.06.2014, 21:03

Forum Jump:


Users browsing this thread: 3 Guest(s)