Random Numbers

I finally got around to replacing the old outmoded random number generator that the MUD has been using for ages. It’s the Mitchell-Moore algorithm and is present in just about every free codebase.

I ended up building a class that lets you select one of three random number generators to run the MUD engine on.

The first is the plain-old slow, ineffecient, and repetitive .NET random number generator.

The second is the R250/521 shift-register sequence generator. There’s a paper on it here:
http://www.informs-cs.org/wsc97papers/0127.PDF

The third is the Mersenne Twister, a fairly new algorithm by Matsumora and Nishimura. More information is available here:
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html

The neat thing about how I’ve set up the random number system is that new algorithms can be dropped in easily. I’m sure there won’t be much cause to change random number generators, but it’s a pretty easy option if we feel like it.

We’re now down to 2,591 compiler errors.

Categories: C#