How does a 1-10 simple number generator work?
How does a 1-10 simple number generator work?
is is a random number generator between 1 - 10 ?
yes, without built in fucntions.
This article is a good start.
The most common method used in computer laguages is called the linear congruential method.
Something with multiplication of a seed and modulo a big prime number.
But hey, I'm lazy so all I do if I want a number between 1 and 10:
Random Rnd = new Random();
int numb = Rnd.Next(1,11);
Exactly, I am asking what is inside the Random(); fucntion.
What is inside Random(), I think you have to ask that to a guy at MicroSoft
This is a list of possibilities
Actually it's right in the MSDN article on the Random Class
The current implementation of the Random class is based on Donald E. Knuth's subtractive random number generator algorithm. For more information, see D. E. Knuth. "The Art of Computer Programming, volume 2: Seminumerical Algorithms". Addison-Wesley, Reading, MA, second edition, 1981.
Then a simple search on google yielded this thread
What is inside Random class, download ILSpy and see.