Skip to content

Instantly share code, notes, and snippets.

@bmorrisondev
Created February 17, 2020 15:35
Show Gist options
  • Select an option

  • Save bmorrisondev/d6dada1fef800090916fb642db45b40c to your computer and use it in GitHub Desktop.

Select an option

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.
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