Skip to content

Instantly share code, notes, and snippets.

@bpostlethwaite
Created June 14, 2014 05:09
Show Gist options
  • Save bpostlethwaite/c7a35433ec358626238e to your computer and use it in GitHub Desktop.
Save bpostlethwaite/c7a35433ec358626238e to your computer and use it in GitHub Desktop.
function randIntGenerator(min, max) {
if (!min) min = 50
if (!max) max = 250
return function () {
return Math.floor(Math.random() * (max - min + 1)) + min
}
}
// this creates a function that outputs a random integer in the specified range
randGrid = randIntGenerator(0,22)
x = randGrid()
y = randGrid()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment