RandomEx to include max?
#1

pawn Код:
public RandomEx(min, max)
{
    return random(max - min) + min;
}
I noticed an issue that this won't include the maximum amount i.e

If I do RandomEx(1, 2) it will only be 1. How can I make it include 2 as well?
Reply


Messages In This Thread
RandomEx to include max? - by Dokins - 09.05.2016, 17:56
Re: RandomEx to include max? - by Konstantinos - 09.05.2016, 17:59
Re: RandomEx to include max? - by Dokins - 09.05.2016, 18:04
Re: RandomEx to include max? - by vannesenn - 09.05.2016, 18:06

Forum Jump:


Users browsing this thread: 2 Guest(s)