Skip to content

Instantly share code, notes, and snippets.

@mike-neck
Created July 5, 2011 08:29
Show Gist options
  • Save mike-neck/1064485 to your computer and use it in GitHub Desktop.
Save mike-neck/1064485 to your computer and use it in GitHub Desktop.
creates random integer between given range
IntRange.metaClass.random = {(new Random()).nextInt(delegate.to - delegate.from + 1) + delegate.from}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment