Created
June 14, 2014 05:09
-
-
Save bpostlethwaite/c7a35433ec358626238e to your computer and use it in GitHub Desktop.
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 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