Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How to make an RNG
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
StealthArcher




PostPosted: Fri Feb 23, 2007 3:18 pm   Post subject: How to make an RNG

Are there specific types?

Is ythere a specific lnguage that is best?

How would you code it anyway?
Sponsor
Sponsor
Sponsor
sponsor
klopyrev




PostPosted: Fri Feb 23, 2007 4:28 pm   Post subject: Re: How to make an RNG

If by RNG, you mean Random Number Generator, you might want to consider looking at The Art of Computer Programming, Volume 2 by Donald Knuth. The entire third chapter is dedicated into Random Numbers. Some of the ones studied there are the linear congruential method (Xn+1 = (aXn + c) mod m), which is the most common type in programming languages. Also, Lagged Fibonacci generator, Mersenne twister, etc. Look at the book or even here:
http://en.wikipedia.org/wiki/List_of_random_number_generators

As for the language, I am not an expert, but I don't think it matters too much.

Coding the RNG is also, pretty simple. It really depends on which generator you want to use.

Konstantin Lopyrev
wtd




PostPosted: Fri Feb 23, 2007 4:33 pm   Post subject: RE:How to make an RNG

Any language which can generate a random number, and which can loop. It's a very small list.

Oh, and presumably you'd use a computer to code it.
klopyrev




PostPosted: Fri Feb 23, 2007 4:36 pm   Post subject: Re: How to make an RNG

lol, nice answer!
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: