seeded randbetween

This commit is contained in:
Laetitia (O-01-67) 2023-02-22 07:32:50 -05:00 committed by GitHub
parent 61df43961c
commit 174a16262a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -67,6 +67,16 @@
}
} //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
//Shallow array comparer by SO Tim Down: https://stackoverflow.com/a/10260204