function MyRandom() {
		this.seedMod = Math.round(Math.random() * 100);
		this.seedModInc = Math.round(Math.random() * 100) + 89;
		this.initSeed();
}

MyRandom.prototype.randomBaseOne = function(n) {
	var m = this.random(n);
	return m+1;
}

MyRandom.prototype.random = function(n) {
	if (n < 2) return 0;
	if (!this.seed) this.reInitSeed();
	this.seed = (0x015a4e35 * this.seed) % 0x7fffffff;
	return (this.seed >> 16) % n;
}

MyRandom.prototype.initSeed = function() {
	var now = new Date();
	this.seed = (this.seedMod + now.getTime()) % 0xffffffff;
}

MyRandom.prototype.reInitSeed = function() {
	this.seedMod += this.seedModInc;
	this.initSeed();
}

MyRandom.prototype.dice = function(number, sides) {
	var sum = 0;
	var i;
	var cnts = new Array(sides);
	for (i=0; i<=sides; ++i) {
		cnts[i] = 0;
	}
	for (i=0; i<number; ++i) {
		var roll = this.randomBaseOne(sides);
		sum += roll;
		cnts[roll] += 1;
	}
	cnts[0] = sum;
	return cnts;
}
