mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-14 13:41:05 +00:00
Update rand.js
This commit is contained in:
parent
f0e5197e92
commit
a59d5210d5
|
@ -12,6 +12,10 @@ function getInt(min, max) {
|
||||||
return Math.floor(randomize() * (max - min + 1)) + min;
|
return Math.floor(randomize() * (max - min + 1)) + min;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getSeed() {
|
||||||
|
return getInt(10000000, 99999999);
|
||||||
|
}
|
||||||
|
|
||||||
function one(arr) {
|
function one(arr) {
|
||||||
return arr[getInt(0, arr.length - 1)];
|
return arr[getInt(0, arr.length - 1)];
|
||||||
}
|
}
|
||||||
|
@ -105,6 +109,7 @@ function discardOne(arr, filename) {
|
||||||
|
|
||||||
exports.randomize = randomize;
|
exports.randomize = randomize;
|
||||||
exports.getInt = getInt;
|
exports.getInt = getInt;
|
||||||
|
exports.getSeed = getSeed;
|
||||||
exports.one = one;
|
exports.one = one;
|
||||||
exports.makeString = makeString;
|
exports.makeString = makeString;
|
||||||
exports.uuidv4 = uuidv4;
|
exports.uuidv4 = uuidv4;
|
||||||
|
@ -114,6 +119,6 @@ exports.sample = sample;
|
||||||
exports.discardOne = discardOne;
|
exports.discardOne = discardOne;
|
||||||
exports.discardCallback = discardCallback;
|
exports.discardCallback = discardCallback;
|
||||||
|
|
||||||
exports.VERSIONINFO = "Random Module (rand.js) version 0.5";
|
exports.VERSIONINFO = "Random Module (rand.js) version 0.6";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user