ekelokorpi/panda.js — pull request #34 by cubiq (2014-02-21 16:26:32+00:00)
Title: random integer and seeded random generator

See if you like it, test with:

// 10 random floats
for ( var i = 0; i < 10; i++ ) {
console.log( game.Math.random(1, 10) );
}

// 10 random integers
for ( var i = 0; i < 10; i++ ) {
console.log( game.Math.randomInt(1, 10) );
}

// 10 random seeded floats (they are always the same per seed)
game.Math.randomSeed(1);	// seed the random number generator (defaulted to Date.now())
for ( var i = 0; i < 10; i++ ) {
console.log( game.Math.random(1, 10, true) );
}

// 10 random seeded integers (no need to reseed the generator)
for ( var i = 0; i < 10; i++ ) {
console.log( game.Math.randomInt(1, 10, true) );
}