PGSystemTester

Javascrtip Random Number Generator

Aug 7th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  // Returns a random integer in an inclusive range of min to max
  2.  // example getRandInt(1,6) will simulate rolling dice.
  3.  
  4. function getRandInt(min, max) {
  5.     return Math.floor(Math.random() * (max - min + 1)) + min;
  6. }
Add Comment
Please, Sign In to add comment