What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Random number generator?

Pages: (2): « First « 1 [ 2 ] Last »
Random number generator?
Author: Message:
LunarCrisis
New Member
*

Avatar

Posts: 12
– / Male / –
Joined: Sep 2003
RE: RE: Random number generator?
quote:
Originally posted by KeyStorm
randInt = ( rand() % 10 ) + 1;

or similar


Actually, since the low order bits are usually less random (using rand()) then the higher order bits, this would be more random:

randInt = (int)( rand() / (RAND_MAX + 1) * 10 + 1 )

the method previously posted uses only the lowest few bits (the least random), while this method relies mostly on the high order bits.

Yes, it's picky :p

This post was edited on 09-06-2004 at 04:42 AM by LunarCrisis.
I wish I were Yulia from t.A.T.u.
Not because of how she looks,
but because she gets to kiss Lena :P
09-06-2004 04:41 AM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Random number generator?
maybe you can use the various dice roller plugins. They do nothing more then generating a random number (also between 1 and 10):

dierollerversion21 by Anthony Meaden:
http://shoutbox.menthix.net/showthread.php?tid=28...d=274813#pid274813

D&D dice roller by Baruchi:
http://shoutbox.menthix.net/showthread.php?tid=20319

Dice Roller by DJMystic:
http://shoutbox.menthix.net/showthread.php?tid=14720
(unavailable)
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-06-2004 01:05 PM
Profile PM Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« Next Oldest Return to Top Next Newest »


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