* CookieRevised slaps people not properly reading a plain simple post around with a large trout
quote:
Originally posted by Jesus
both will do the job, but... I didn't expect you to be this sloppy cookie, in your average posts you wouldn't use -1+1... getting sleepy??
Jesus, read what -!Felu!- has written, then read my post again,
properly... There is absolutely nothing sloppy about my post.
--
quote:
Originally posted by Jesus
I'd use Math.floor(Math.random() * 101); tbh(Smilie)
Then you're wrong. It will generate random numbers from
0 to 100.
See my previous post.
quote:
Originally posted by foaly
shouldn't it be: Math.floor(Math.random() * 99 + 1)?
No, that will generate numbers from 1 to
99.
See my previous post.
it should be
Math.floor((upperbound - lowerbound + 1) * Math.random() + lowerbound);
thus
Math.floor((100 - 1 + 1) * Math.random() + 1);
thus
Math.floor(Math.random() * 100 + 1);
See my previous post