Skip to content

Instantly share code, notes, and snippets.

@brandoncc
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandoncc/ab3c27bac9da789e830a to your computer and use it in GitHub Desktop.
Save brandoncc/ab3c27bac9da789e830a to your computer and use it in GitHub Desktop.
// choose a random number which is inclusively between min and max
chooseRandomBetween = function(min, max) {
var difference = Math.abs(max - min) + 1;
return Math.floor(Math.random() * difference) + Math.min(min, max);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment