An attempt at a "smoothed" random generator. Each consecutive generated number is constrained to be within an envelope near the previous number. The width of the envelope is controlled by the inverse of the smoothing factor; thus higher factors will produce output that varies less from number to number.
var r = SmoothRandom(2);
var d = [];
while (d.length < 100) {