How to make an RNG
Author |
Message |
StealthArcher
![](http://compsci.ca/v3/uploads/user_avatars/18949255664b176c4f1481b.jpg)
|
Posted: 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? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
klopyrev
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
klopyrev
|
Posted: Fri Feb 23, 2007 4:36 pm Post subject: Re: How to make an RNG |
|
|
lol, nice answer! |
|
|
|
|
![](images/spacer.gif) |
|
|