Created
February 17, 2020 15:35
-
-
Save bmorrisondev/d6dada1fef800090916fb642db45b40c to your computer and use it in GitHub Desktop.
A simple psuedo-random number generator. Pass it a min and max number and it will return a random number in that range.
This file contains hidden or 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 rng (min, max) { | |
| var num = Math.random() * (max - min) + min; | |
| return Math.floor(num) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment