<@U1FSX0QG6>: You can use `invoke` to make a class...
# getting-started
j
@vaughandroid: You can use
invoke
to make a class invokeable. Say I had something like
Copy code
class Dice(val number: Int, val sides: Int) {
    val random = Random()
    operator fun invoke(): List<Int> {
        return (1..number).map { random.nextInt(sides) + 1 }
    }
}


fun main(args: Array<String>) {
    val d6 = Dice(1, 6)
    val twoD6 = Dice(2, 6)

    println(d6())
    println(twoD6())
}