/*
Write a function called randUpTo
that accepts a number and returns a
random whole number between 0 and that number?
*/
var randUpTo = function(num) {
return Math.floor(Math.random() * (num - 1) + 0);
};
/*
Write a function called randBetween
that accepts two numbers
representing a range and returns a random whole number between those two
numbers.
*/
var randBetween = function (min, max) {
return Math.floor(Math.random() * (max - min - 1)) + min;
};
/*
Write a function called randFromTill
that accepts two numbers
representing a range and returns a random number between min (inclusive)
and max (exclusive).
*/
var randFromTill = function (min, max) {
return Math.random() * (max - min) + min;
};
/*
Write a function called randFromTo
that accepts two numbers
representing a range and returns a random integer between min (inclusive)
and max (inclusive)
*/
var randFromTo = function (min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
};