What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Request] Random Number Generator

[Request] Random Number Generator
Author: Message:
Jesus
Scripting Contest Winner
****

Avatar
Koffie, my cat ;)

Posts: 623
Reputation: 15
37 / Male / Flag
Joined: Jul 2005
RE: RE: [Request] Random Number Generator
quote:
Originally posted by CookieRevised
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. ^o)
I don't see any post by -!Felu!- in this thread...
maybe he deleted it?

quote:
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.
quote:
Originally posted by foaly

Then you still can get 0...

true, I noticed that and corrected it as you were typing ;)

quote:
[b]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);

Sorry, I never saw you or anyone else post the Math.floor((upperbound - lowerbound + 1) * Math.random() + lowerbound); part. that would have made it a lot clearer ;)

at least we agree on the Math.floor(Math.random() * 100 +1); part ;)
12-03-2006 02:21 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Request] Random Number Generator - by Slacker on 12-01-2006 at 04:47 PM
RE: [Request] Random Number Generator - by CookieRevised on 12-01-2006 at 07:44 PM
RE: RE: [Request] Random Number Generator - by Jesus on 12-02-2006 at 01:17 AM
RE: [Request] Random Number Generator - by foaly on 12-02-2006 at 01:25 AM
RE: [Request] Random Number Generator - by CookieRevised on 12-02-2006 at 01:28 AM
RE: RE: [Request] Random Number Generator - by Jesus on 12-03-2006 at 02:21 AM
RE: [Request] Random Number Generator - by CookieRevised on 12-03-2006 at 05:44 AM
RE: RE: [Request] Random Number Generator - by Jesus on 12-03-2006 at 10:37 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On