Another way of implementing s1m0nw1's answer would be to access it through a variable. Not that its any more efficient but it saves you from having to type ().
val ClosedRange.random: Int
get() = Random().nextInt((endInclusive + 1) - start) + start
And now it can be accessed as such
(1..10).random