Quote:
Originally Posted by greggiles
So if I were to be doing 1 or 3, itd be..
PHP Code:
this.number = int(random(1,3);
|
No.
random(1,3) gives you a random number between 1 and 3 (though never the high number, in this case 3.) So for example, random(1,3) might give you 2.5, or 1.72, etc.
int() then rounds the number down to the nearest integer. (so 2.5 becomes 2, 1.99 becomes 1.)
So
PHP Code:
this.number = int(random(1,3));
Would randomly select either 1 or 2.