Skip to content

Instantly share code, notes, and snippets.

@jazzedge
Created July 12, 2017 05:40
Show Gist options
  • Select an option

  • Save jazzedge/f5bbfa34347a00d6ea3c6291efe14d12 to your computer and use it in GitHub Desktop.

Select an option

Save jazzedge/f5bbfa34347a00d6ea3c6291efe14d12 to your computer and use it in GitHub Desktop.
Bot Random integer
// Call like this:
var r = randomInt(1,10);
//Display like this:
session.send ('Random n.'+ r); // Use the plus sign, not a comma.
// Generate a random integer between low and high
function randomInt (low, high) {
return Math.floor(Math.random() * (high - low) + low);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment