seeded randbetween
This commit is contained in:
parent
61df43961c
commit
174a16262a
|
|
@ -67,6 +67,16 @@
|
||||||
}
|
}
|
||||||
} //returns random function seeded with a
|
} //returns random function seeded with a
|
||||||
|
|
||||||
|
//Seeded randbetween
|
||||||
|
function seededRandBetween(min,max,randomFunction) {
|
||||||
|
if(min > max) {
|
||||||
|
var temp = max;
|
||||||
|
max = min;
|
||||||
|
min = temp;
|
||||||
|
};
|
||||||
|
return Math.floor(randomFunction() * (max - min + 1)) + min
|
||||||
|
};
|
||||||
|
|
||||||
//Arrays
|
//Arrays
|
||||||
|
|
||||||
//Shallow array comparer by SO Tim Down: https://stackoverflow.com/a/10260204
|
//Shallow array comparer by SO Tim Down: https://stackoverflow.com/a/10260204
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue