Random.js
A random library for JavaScript.
A utility library with several random functions that can be seeded.
Random.js implements the Mersenne Twister pseudorandom number generator.
For not seeded float number generation Math.random() is slightly faster.
Documentation
Usage
Basic usage of the library.
var ra = new Random();

var seeded = new Random(2015);
Without a seed one is created based on the current time.
nextInt(max)
Generates a random integer inside [0, max).
ra.nextInt(15)

		
nextFloat()
Generates a random float inside [0, 1).
ra.nextFloat()

		
nextBool()
Generates a random boolean.
ra.nextBool()

		
nextIntRange(min, max)
Generates a random integer inside [min, max).
ra.nextIntRange(10, 100)
nextFloatRange(min, max)
Generates a random float inside [min, max).
ra.nextFloatRange(-1, 1)
nextItem(array)
Gets a random item from an array.
ra.nextFloatRange(["Blap", "Blop", "Blip"])

		
nextGaussian()
Generates a guassian random number with mean equal to 0 and standard deviation equal to 1.
A close proximation.
ra.nextGaussian()

		
Created by Akritas Akritidis