Possible Duplicate:
How to create my own JavaScript Random Number generator that I can also set the seed
So, if I have this function:
function randArr(count, low, high) {
var result = [];
for (var i=0; i<count; i++) {
result.push(seededRand(low, high));
}
return result;
}
every time I call randArr(5, 1, 100)
I would get the same array back, e.g. [54, 23, 1, 9, 15]
.
Update: I think this is a dupe, but since commentors seem confused, the question is, how to write seededRand()
?