I am looking for a unique function that can generate a number within a specified range, based on a provided number.
An example of the function would be:
function getNumber(minimum, maximum, number) {
...
}
If I were to input:
getNumber(0, 3, 12837623);
The function should utilize the third argument and provide a number between 0 and 3 (inclusive or exclusive), consistently generating the same outcome when run multiple times with the same parameters.
This function has similarities to a random number generator, but instead of using a random number it operates based on the given number.
function getRndInteger(min, max) {
return Math.floor(Math.random() * (max - min + 1) ) + min;
}
function getNumber(min, max, number) {
//calculates based on third argument rather than using random number
return Math.floor(number * (max - min + 1) ) + min;
}