[code] Simple Random Number Generator
Ever wanted to set your own seed in a random number generator? Ever wanted to see what one looks like? Well have no fear, since this simple piece of code shall show you how it looks like!
[gist]5689619[/gist]
The major caveat is that it's a Lehmer Random Number Generator (which I think is what Math.random() uses anyways), which means it cycles a full period multiplier (that is modulus compatible) every (2^31-1)nth time. For most cases it is useful though. The benefit of having this separate is because Math.random() doesn't seem to allow you to set your own seed which is crucial when testing things out or making sure your gameworld is unique from someone else's, and remains the same uniqueness by storing the seed.
It's also useful for anti-cheating. Imagine a chest that has randomized loot. If the seed was selected "at random" (by using the system clock), then each time you reload your game and open that chest something different appears, which could be a good item, and so you could save-farm it for a good item. However, by storing the seed you are no longer picking "at random" anymore and you'll get the same item out of the chest each time. By choosing a different seed per game means different items per game, which means no two games are the same, but two saves of the same game will at least be the same, which is a good property to have to combat "random" cheating.
But, I myself abuse randomness all the time in games. The downside is it can be predictable. In the game Kings Bounty, the turns are based on a saved seed (which is based on the last 'n' turns you did). That means I can load the game, go into a battle and if I do the same moves I expect the same retaliations from the enemy. I can then die, reload, and then restart knowing exactly how they'll retaliate and be ready for it. So there is this downside as well! So case in point, some things need to be truly "random" while other things should not. As a game designer you choose what should and should not be stored as a seed.
There you go guys! I hope I've enlightened you on some things. 
To use:
// setup random generator with system-clock time.
var rand1 = new Random();
// setup random generator with fixed seed.
var rand2 = new Random(123456789);
var r = rand1.next(); // exactly the kind of number you get from Math.random()