I need a function that will generate a number between two other numbers, based on a given number.
If the function looks like this:
function getNumber(minimum, maximum, number) {
...
}
And if I input this:
getNumber(0, 3, 12837623);
It should process the third argument, and give me a number between 0 and 3 (inclusive or non-inclusive), based on it, and if I run it multiple times with the same arguments I should get the same number.
It is kind of similar to a random number function, except it uses the given number instead of a random one.
function getRndInteger(min, max) {
return Math.floor(Math.random() * (max - min + 1) ) + min;
}
function getNumber(min, max, number) {
//uses third argument instead of random number
return Math.floor(number * (max - min + 1) ) + min;
}