03 & 04 exercises (#96)

This commit is contained in:
NikitaLipatov
2018-12-28 19:25:01 +03:00
committed by Aditya Bhargava
parent 2bf2ab5062
commit 8a0a191975
8 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
private fun countdown(i: Int) {
println(i)
when {
// base case
i <= 0 -> return
// recursive case
else -> countdown(i - 1)
}
}
fun main(args: Array<String>) = countdown(5)