//class LazyProperty(val initializer: () -> Int) {
//    var xvalue:Int?=null
//    val lazy: Int
//        get() {
//          return xvalue!!
//        }
//
//}
import com.sun.tools.javac.jvm.Code.truncate
import kotlin.concurrent.timer
import kotlin.math.floor
import kotlin.math.round
import kotlin.math.sqrt
import kotlin.properties.Delegates
import kotlin.random.Random
import kotlin.random.nextInt
import kotlin.system.measureTimeMillis
import kotlin.time.DurationUnit
import kotlin.time.toDuration

fun main(){

//    val isEven: Int.() -> Boolean = {this.rem(2)== 0}
//    val isOdd: Int.() -> Boolean = {this%2 != 0 }
////
////  println(listOf(isOdd(43), 239.isOdd(), 294823098.isEven()))
//    println( Random(10).nextInt(1..10))
////    println( Random(10))
//    println(3.toDuration( DurationUnit.SECONDS))
//    println(measureTimeMillis{println("hello world")})
//
//
//    println(Random.nextInt(1,100))
//    println(Random.nextInt(1,100))
 getIndices(-1) // will fail with IllegalArgumentException

    println(getIndices(3)) // [1, 2, 3]
    var mNumber: Int by Delegates.notNull<Int>()
}

fun getIndices(count: Int): List<Int> {
    require(count >= 0)
    // ...
    return List(count) { it + 1 }
}

