Miniprogramm Kotlin
This commit is contained in:
commit
2e71189688
32
onboarding.kt
Normal file
32
onboarding.kt
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
fun main() {
|
||||||
|
val name = "Koshka"
|
||||||
|
val favouriteActivities = listOf("jumping on the trees", "eating bananas", "doing jumpscares to other animals", "doing funny sounds")
|
||||||
|
|
||||||
|
println("Monkey whose name is $name like to $favouriteActivities")
|
||||||
|
Thread.sleep(5000)
|
||||||
|
|
||||||
|
println("Also...")
|
||||||
|
Thread.sleep(3000)
|
||||||
|
|
||||||
|
println("Monkey $name like to sleep. Very much.")
|
||||||
|
Thread.sleep(1000)
|
||||||
|
|
||||||
|
println("Look!")
|
||||||
|
for (i in 5 downTo 0) {
|
||||||
|
if(i == 0) {
|
||||||
|
println("Zzz...")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
println("Monkey $name will fall asleep in $i")
|
||||||
|
Thread.sleep(1500)
|
||||||
|
}
|
||||||
|
println("How do you think how long in hours will monkey $name sleep?")
|
||||||
|
|
||||||
|
getGuessTheTime(userTime = getTime(), name = name)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getTime() : Int? = readLine()?.toInt()
|
||||||
|
fun getGuessTheTime(userTime: Int?, name: String?) {
|
||||||
|
println("You think monkey $name will sleep $userTime hours,\n but noup, monkey $name will sleep 67 hours\n uhehehehehehehh :DDDDDD ")
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user