8 min read Beginner
Kotlin testing has a problem that gets worse the more successful your project becomes.
The Kotlin language itself — idioms, features and fundamentals, learned hands-on.
8 min read Beginner
Kotlin testing has a problem that gets worse the more successful your project becomes.
Kotlin Koans BR · Part 12
2 min read Beginner
When importing a class or function, you can give it a different name by adding as NewName after the import directive. This can be useful when…
Kotlin Koans BR · Part 13
4 min read Beginner
Implement the extension functions Int.r() and Pair.r() so they convert an Int and a Pair into a RationalNumber.
Kotlin Koans BR · Part 2
2 min read Beginner
Make the joinOptions() function return the list in JSON format (for example, [a, b, c]) by specifying only two arguments.
Kotlin Koans BR · Part 3
4 min read Beginner
Imagine you have several overloads of foo() in your favorite language. You can replace them all with a single function in Kotlin.
Kotlin Koans BR · Part 9
9 min read Beginner
Rewrite the following code in Kotlin, then add the data modifier. A beginner-friendly look at Kotlin classes and data classes.
Kotlin Koans BR · Part 11
12 min read Beginner
Reuse your solution from the previous task, but replace the interface with a sealed interface. That way you no longer need the else branch in the when expression.
Kotlin Koans BR · Part 8
3 min read Beginner
Pass a lambda to the any function to check whether the collection contains an even number.
Kotlin Koans BR · Part 5
2 min read Beginner
The pattern below matches a date in the format 13.06.1992 (two digits, a dot, two digits, a dot, four digits):
Kotlin Koans BR · Part 1
5 min read Beginner
Change the code so that the start function returns the string "OK".
Kotlin Koans BR · Part 4
2 min read Beginner
Swap the trimIndent call for trimMargin, setting # as the prefix value, so the resulting string no longer contains the prefix character.
Kotlin Koans BR · Part 10
7 min read Beginner
Rewrite the given code using Kotlin smart casts and the when expression.
Kotlin Koans BR · Part 7
2 min read Beginner
Specify the Nothing return type for the failWithWrongAge function.
Kotlin Koans BR · Part 6
5 min read Beginner
Rewrite the following code so that it uses only a single if expression, and learn how Kotlin handles nullable types safely.