02.10.2014, 11:30
Alright, let's suppose that you pass 100 and 250 to the function. What you would end up with (internally) is this:
Which in turn gets simplified to
Now, as you know the random function now returns a random value between 0 and 150. Let's suppose the random value is 0. The 100 from before gets added and 100 is returned. Let's suppose the random value is 149. Again, the 100 from before gets added and 249 is returned.
Usage is just the same as the regular random function.
pawn Код:
return 100 + random(250 - 100)
pawn Код:
return 100 + random(150)
Usage is just the same as the regular random function.
pawn Код:
new randomNumber = minrandom(100, 250);