This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function randInt(min,max){ | |
var range = max - min; | |
// it actually does work the other way... | |
// if (range < 0) { throw new RangeError("min must be less than max"); } | |
var rand = Math.floor(Math.random() * (range + 1)); | |
return min + rand; | |
} |