Created
August 5, 2018 19:29
-
-
Save mrmitew/72269452ed496b28bac0169530038882 to your computer and use it in GitHub Desktop.
Get a random number that is in a given closed range
This file contains 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
fun ClosedRange<Int>.random() = Random().nextInt(endInclusive - start) + start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment