how do you specify the range of numbers in in math.random()?
thx
Math.random()*yourNumberHere;
or
Math.floor(Math.random()*maxNumber+minNumber)
shouldn’t it be
minNumber+Math.random()*(maxNumber-minNumber);
ahmed?
oops
yeah
:beam:
Ive always done it Math.floor(Math.random()*(high-low))+low
Well… I guess we have a thread that shows a whole bunch of different ways to approach the same thing
thx guys
no problem. =)
Math.round(Math.random());
will give 0 or 1 every time.
that can be useful sometimes.