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:
Phrive
Full Member
***

Avatar
...!Phrive!...

Posts: 401
Reputation: 4
35 / Male / –
Joined: May 2004
O.P. Random number generator?
has any1 got a sourse code for a random number generator that generates one number bettween 1 and 10 i posted it in tech tlk but no reply plz i need it badly
[Image: 1thing5hk.gif]

07-23-2004 01:40 PM
Profile E-Mail PM Find Quote Report
KeyStorm
Elite Member
*****

Avatar
Inn-sewer-ants-pollie-sea

Posts: 2156
Reputation: 45
38 / Male / –
Joined: Jan 2003
RE: Random number generator?
It can't be so difficult, which language?
07-23-2004 01:43 PM
Profile E-Mail PM Web Find Quote Report
Phrive
Full Member
***

Avatar
...!Phrive!...

Posts: 401
Reputation: 4
35 / Male / –
Joined: May 2004
O.P. RE: Random number generator?
i have done it b4 and i was tryin 2 remeber it but i cudnt get it to work properly c++

This post was edited on 07-23-2004 at 01:44 PM by Phrive.
[Image: 1thing5hk.gif]

07-23-2004 01:44 PM
Profile E-Mail PM Find Quote Report
Millenium_edition
Veteran Member
*****

Avatar

Posts: 1787
Reputation: 57
Joined: Apr 2003
RE: Random number generator?
in vb it's
code:
Randomize
intRandomNumber = Int(Rnd * 99999)

c++? damn. sorry :s

This post was edited on 07-23-2004 at 01:46 PM by Millenium_edition.
07-23-2004 01:44 PM
Profile E-Mail PM Find Quote Report
KeyStorm
Elite Member
*****

Avatar
Inn-sewer-ants-pollie-sea

Posts: 2156
Reputation: 45
38 / Male / –
Joined: Jan 2003
RE: Random number generator?
randInt = ( rand() % 10 ) + 1;

or similar
07-23-2004 01:50 PM
Profile E-Mail PM Web Find Quote Report
Phrive
Full Member
***

Avatar
...!Phrive!...

Posts: 401
Reputation: 4
35 / Male / –
Joined: May 2004
O.P. RE: Random number generator?
kk ill try it !!
[Image: 1thing5hk.gif]

07-23-2004 01:52 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Random number generator?
http://www.robertjacobs.fsnet.co.uk/random.htm

[Image: google.gif] <-- This is a link to a Google Search

This post was edited on 07-23-2004 at 02:18 PM by matty.
07-23-2004 02:18 PM
Profile E-Mail PM Find Quote Report
Phrive
Full Member
***

Avatar
...!Phrive!...

Posts: 401
Reputation: 4
35 / Male / –
Joined: May 2004
O.P. RE: Random number generator?
cheers matty im almost there and thats hlped alot cheers i did search but i cudnt find anything
[Image: 1thing5hk.gif]

07-23-2004 02:19 PM
Profile E-Mail PM Find Quote Report
dotNorma
Veteran Member
*****

Avatar

Posts: 1745
Reputation: 17
33 / Male / –
Joined: May 2003
RE: Random number generator?
Its all over google in any language :-/

code:
In Form_Load()
Randomize
End Sub

Public Function Rand(ByVal Low As Long, _
                     ByVal High As Long) As Long
  Rand = Int((High - Low + 1) * Rnd) + Low
End Function


(Visual Basics)

code:
include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
    int random_integer = rand();
    cout << random_integer << endl;
}

   random_integer = (rand()%10);

(C++)


Notice the VB one makes sense while the C++ one just seems like a bunch of random jabber :p

This post was edited on 07-23-2004 at 05:09 PM by dotNorma.
07-23-2004 05:08 PM
Profile PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Random number generator?
You don't get truly random numbers anyway, just pseudorandom ones. There are iterative formulae that oscillate seemingly wildly between 0 and 1 that are used for random number generators, which is why a lot of them have seeds.
[Image: spartaafk.png]
07-24-2004 09:37 AM
Profile PM Web 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