Skip to content

Commit 940094a

Browse files
committed
fix: links updated
1 parent 82eb6be commit 940094a

File tree

39 files changed

+58
-59
lines changed

39 files changed

+58
-59
lines changed

Builders/Builders implementation/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
Complete the implementation of a simplified DSL for HTML.
44
Implement `tr` and `td` functions.
55

6-
Learn more about [type-safe builders](https://kotlinlang.org/docs/reference/type-safe-builders.html#type-safe-builders).
6+
Learn more about [type-safe builders](https://kotlinlang.org/docs/type-safe-builders.html#type-safe-builders).
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Function literals with receiver
22

3-
Learn about [function literals with receiver](https://kotlinlang.org/docs/reference/lambdas.html#function-literals-with-receiver).
3+
Learn about [function literals with receiver](https://kotlinlang.org/docs/lambdas.html#function-literals-with-receiver).
44

55
You can declare `isEven` and `isOdd` as values, that can be called as extension functions.
66
Complete the declarations in the code.

Builders/The function apply/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ The previous examples can be rewritten using the library function
44
[`apply`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/apply.html).
55
Write your own implementation of this function named `myApply`.
66

7-
Learn about the other [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html)
7+
Learn about the other [scope functions](https://kotlinlang.org/docs/scope-functions.html)
88
and how to use them.

Classes/Data classes/task.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
## Data classes
22

3-
Learn about [classes](https://kotlinlang.org/docs/reference/classes.html),
4-
[properties](https://kotlinlang.org/docs/reference/properties.html)
5-
and [data classes](https://kotlinlang.org/docs/reference/data-classes.html)
3+
Learn about [classes](https://kotlinlang.org/docs/classes.html),
4+
[properties](https://kotlinlang.org/docs/properties.html)
5+
and [data classes](https://kotlinlang.org/docs/data-classes.html)
66
and then rewrite the following Java code to Kotlin:
77

88
```java

Classes/Extension functions/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Extension functions
22

3-
Learn about [extension functions](https://kotlinlang.org/docs/reference/extensions.html).
3+
Learn about [extension functions](https://kotlinlang.org/docs/extensions.html#extension-functions).
44
Then implement the extension functions `Int.r()` and `Pair.r()` and make them convert `Int` and `Pair` to a `RationalNumber`.
55

66
`Pair` is a class defined in the standard library:

Classes/Rename on import/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Rename on import
22

3-
When you [import](https://kotlinlang.org/docs/reference/packages.html#imports)
4-
a class or a function, you can specify a different name to use for it
3+
When you [import](https://kotlinlang.org/docs/packages.html#imports)
4+
a class or a function, you can specify a different name for it
55
by adding `as NewName` after the import directive.
66
This can be useful if you want to use two classes or functions with similar names
77
from different libraries.

Classes/Sealed classes/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Sealed classes
22

33
Reuse your solution from the previous task, but replace the interface
4-
with the [`sealed` class](https://kotlinlang.org/docs/reference/sealed-classes.html).
4+
with the [`sealed` class](https://kotlinlang.org/docs/sealed-classes.html).
55
Then you no longer need the `else` branch in `when`.

Classes/Smart casts/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Smart casts
22

3-
Rewrite the following Java code using [smart casts](https://kotlinlang.org/docs/reference/typecasts.html#smart-casts)
4-
and the [when](https://kotlinlang.org/docs/reference/control-flow.html#when-expression) expression:
3+
Rewrite the following Java code using [smart casts](https://kotlinlang.org/docs/typecasts.html#smart-casts)
4+
and the [when](https://kotlinlang.org/docs/control-flow.html#when-expression) expression:
55

66
```java
77
public int eval(Expr expr) {

Collections/All Any and other predicates/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## All, Any, and other predicates
22

3-
Learn about [testing predicates](https://kotlinlang.org/docs/reference/collection-filtering.html#testing-predicates)
4-
and [retrieving elements by condition](https://kotlinlang.org/docs/reference/collection-elements.html#retrieving-by-condition).
3+
Learn about [testing predicates](https://kotlinlang.org/docs/collection-filtering.html#test-predicates)
4+
and [retrieving elements by condition](https://kotlinlang.org/docs/collection-elements.html#retrieve-by-condition).
55

66
Implement the following functions using
77
[`all`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/all.html),

Collections/Associate/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Associate
22

3-
Learn about [association](https://kotlinlang.org/docs/reference/collection-transformations.html#associate).
3+
Learn about [association](https://kotlinlang.org/docs/collection-transformations.html#associate).
44
Implement the following functions using
55
[`associateBy`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/associate-by.html),
66
[`associateWith`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/associate-with.html),

Collections/Filter map/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Filter; map
22

3-
Learn about [mapping](https://kotlinlang.org/docs/reference/collection-transformations.html#mapping) and
4-
[filtering](https://kotlinlang.org/docs/reference/collection-filtering.html#filtering-by-predicate) a collection.
3+
Learn about [mapping](https://kotlinlang.org/docs/collection-transformations.html#mapping) and
4+
[filtering](https://kotlinlang.org/docs/collection-filtering.html#filtering-by-predicate) a collection.
55

66
Implement the following extension functions
77
using the

Collections/FlatMap/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## FlatMap
22

3-
Learn about [flattening](https://kotlinlang.org/docs/reference/collection-transformations.html#flattening)
3+
Learn about [flattening](https://kotlinlang.org/docs/collection-transformations.html#flatten)
44
and implement two functions using
55
[`flatMap`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/flat-map.html):
66
- The first should return all products the given customer has ordered

Collections/Fold/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Fold
22

3-
Learn about [fold and reduce](https://kotlinlang.org/docs/reference/collection-aggregate.html#fold-and-reduce)
3+
Learn about [fold and reduce](https://kotlinlang.org/docs/collection-aggregate.html#fold-and-reduce)
44
and implement a function that returns the set of products that were ordered by all the customers using
55
[`fold`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/fold.html).
66

Collections/GroupBy/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Group By
22

3-
Learn about [grouping](https://kotlinlang.org/docs/reference/collection-grouping.html).
3+
Learn about [grouping](https://kotlinlang.org/docs/collection-grouping.html).
44
Use
55
[`groupBy`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/group-by.html)
66
to implement the function to build a map that stores the customers living in a given city.

Collections/Introduction/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This section was inspired by [GS Collections Kata](https://github.com/goldmansac
44

55
Kotlin can be easily mixed with Java code.
66
Default collections in Kotlin are all Java collections under the hood.
7-
Learn about [read-only and mutable views on Java collections](https://kotlinlang.org/docs/reference/collections-overview.html#collection-types).
7+
Learn about [read-only and mutable views on Java collections](https://kotlinlang.org/docs/collections-overview.html#collection-types).
88

99
The [Kotlin standard library](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/)
1010
contains lots of extension functions that make working with collections more convenient.

Collections/Max min/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Max min
22

3-
Learn about [Collection Aggregate Operations](https://kotlinlang.org/docs/reference/collection-aggregate.html).
3+
Learn about [collection aggregate operations](https://kotlinlang.org/docs/collection-aggregate.html).
44

55
Implement two functions:
66
- the first should return the customer who has placed the most amount of orders in this shop
@@ -18,7 +18,7 @@ listOf(1, 42, 4).maxOrNull() == 42
1818
listOf("a", "ab").minByOrNull(String::length) == "a"
1919
```
2020

21-
You can use [callable references](https://kotlinlang.org/docs/reference/lambdas.html#instantiating-a-function-type)
21+
You can use [callable references](https://kotlinlang.org/docs/lambdas.html#instantiating-a-function-type)
2222
instead of lambdas. This can be especially helpful in call chains, where
2323
`it` occurs in different lambdas and has different types.
2424
Implement the `getMostExpensiveProductBy` function using callable references.

Collections/Partition/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Partition
22

3-
Learn about [partitioning](https://kotlinlang.org/docs/reference/collection-filtering.html#partitioning)
4-
and the [destructuring declaration](https://kotlinlang.org/docs/reference/multi-declarations.html)
3+
Learn about [partitioning](https://kotlinlang.org/docs/collection-filtering.html#partition)
4+
and the [destructuring declaration](https://kotlinlang.org/docs/destructuring-declarations.html)
55
syntax that is often used together with `partition`.
66

77
Then implement a function for returning customers who have more undelivered orders

Collections/Sequences/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Sequences
22

3-
Learn about [sequences](https://kotlinlang.org/docs/reference/sequences.html),
3+
Learn about [sequences](https://kotlinlang.org/docs/sequences.html),
44
they allow you to perform operations lazily rather than eagerly.
55
Copy the implementation from the previous task and modify it in a way
66
that the operations on sequences are used.

Collections/Sort/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
## Sort
22

33
Learn about
4-
[collection ordering](https://kotlinlang.org/docs/reference/collection-ordering.html)
4+
[collection ordering](https://kotlinlang.org/docs/collection-ordering.html)
55
and the
6-
[the difference](https://kotlinlang.org/docs/reference/collection-operations.html#write-operations)
6+
[the difference](https://kotlinlang.org/docs/collection-operations.html#write-operations)
77
between operations in-place on mutable collections and operations returning new collections.
88

99
Implement a function for returning the list of customers,

Collections/Sum/task.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ Note that each product should be counted as many times as it was ordered.
66

77
Use
88
[`sum`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/sum.html) or
9-
[`sumBy`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/sum-by.html).
10-
If you want to sum up double values, use
11-
[`sumByDouble`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/sum-by-double.html).
9+
[`sumOf`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/sum-of.html).
10+
If you want to sum up double values, use `sumOfDouble`.
1211

1312
```kotlin
1413
listOf(1, 5, 3).sum() == 9
15-
listOf("a", "b", "cc").sumBy { it.length } == 4
14+
listOf("a", "b", "cc").sumOf { it.length } == 4
1615
```

Conventions/Comparison/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
## Comparison
22

3-
Learn about [operator overloading](https://kotlinlang.org/docs/reference/operator-overloading.html)
3+
Learn about [operator overloading](https://kotlinlang.org/docs/operator-overloading.html)
44
and how the different conventions for operations like `==`, `<`, `+` work in Kotlin.
55
Add the function `compareTo` to the class `MyDate` to make it comparable.
66
After this the code below `date1 < date2` should start to compile.
77

88
Note that when you override a member in Kotlin, the
9-
[`override`](https://kotlinlang.org/docs/reference/classes.html#overriding-members)
9+
[`override`](https://kotlinlang.org/docs/inheritance.html#overriding-methods)
1010
modifier is mandatory.

Conventions/For loop/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
## For loop
22

3-
A Kotlin [for loop](https://kotlinlang.org/docs/reference/control-flow.html#for-loops)
3+
A Kotlin [for loop](https://kotlinlang.org/docs/control-flow.html#for-loops)
44
can iterate through any object if the corresponding `iterator` member or extension function is available.
55

66
Make the class `DateRange` implement [`Iterable<MyDate>`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/),
77
so that it can be iterated over.
88
Use the function `MyDate.followingDate()` defined in `DateUtil.kt`;
99
you don't have to implement the logic for finding the following date on your own.
1010

11-
Use an [object expression](https://kotlinlang.org/docs/reference/object-declarations.html)
11+
Use an [object expression](https://kotlinlang.org/docs/object-declarations.html#object-expressions)
1212
which plays the same role in Kotlin as an anonymous class in Java.

Conventions/Invoke/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Invoke
22

3-
Objects with an [`invoke()`](https://kotlinlang.org/docs/reference/operator-overloading.html#invoke)
3+
Objects with an [`invoke()`](https://kotlinlang.org/docs/operator-overloading.html#invoke-operator)
44
method can be invoked as a function.
55

66
You can add an `invoke` extension for any class, but it's better not to overuse it:

Conventions/Ranges/task.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
## Ranges
22

3-
Using [ranges](https://kotlinlang.org/docs/reference/ranges.html)
3+
Using [ranges](https://kotlinlang.org/docs/ranges.html)
44
implement a function that checks whether the date is in the range
55
between the first date and the last date (inclusive).
66

77
You can build a range of any comparable elements.
8-
In Kotlin [`in` checks](https://kotlinlang.org/docs/reference/operator-overloading.html#in)
8+
In Kotlin [`in` checks](https://kotlinlang.org/docs/operator-overloading.html#in-operator)
99
are translated to the corresponding `contains` calls
10-
and [`..`](https://kotlinlang.org/docs/reference/operator-overloading.html#arithmetic)
10+
and [`..`](https://kotlinlang.org/docs/operator-overloading.html#arithmetic-operators)
1111
to `rangeTo` calls:
1212

1313
```kotlin

Generics/Generic functions/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Generic functions
22

3-
Learn about [generic functions](https://kotlinlang.org/docs/reference/generics.html#generic-functions).
3+
Learn about [generic functions](https://kotlinlang.org/docs/generics.html#generic-functions).
44
Make the code compile by implementing a `partitionTo` function that splits
55
a collection into two collections according to the predicate.
66

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
fun foo(name: String, number: Int = 42, toUpperCase: Boolean = false) =
2-
(if (toUpperCase) name.toUpperCase() else name) + number
1+
fun foo(name: String, number: Int = 42, upperCase: Boolean = false) =
2+
(if (upperCase) name.uppercase() else name) + number
33

44
fun useFoo() = listOf(
55
foo("a"),
66
foo("b", number = 1),
7-
foo("c", toUpperCase = true),
8-
foo(name = "d", number = 2, toUpperCase = true)
7+
foo("c", upperCase = true),
8+
foo(name = "d", number = 2, upperCase = true)
99
)

Introduction/Default arguments/task-info.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ files:
44
visible: true
55
placeholders:
66
- offset: 0
7-
length: 69
7+
length: 67
88
placeholder_text: 'fun foo(name: String, number: Int, toUpperCase: Boolean)'
99
- name: test/tests.kt
1010
visible: false

Introduction/Default arguments/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ public String foo(String name) {
1919

2020
You can replace all these Java overloads with one function in Kotlin.
2121
Change the declaration of the `foo` function in a way that makes the code using `foo` compile.
22-
Use [default and named](https://kotlinlang.org/docs/reference/functions.html#default-arguments) arguments.
22+
Use [default and named](https://kotlinlang.org/docs/functions.html#default-arguments) arguments.

Introduction/Hello, world!/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Simple Functions
22

3-
Check out the [function syntax](https://kotlinlang.org/docs/reference/basic-syntax.html#defining-functions)
3+
Check out the [function syntax](https://kotlinlang.org/docs/basic-syntax.html#defining-functions)
44
and change the code to make the function `start` return the string `"OK"`.
55

66
In the Kotlin Koans tasks the function `TODO()` will throw an exception.

Introduction/Lambdas/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Lambdas
22

33
Kotlin supports functional programming.
4-
Learn about [lambdas](https://kotlinlang.org/docs/reference/lambdas.html#lambda-expressions-and-anonymous-functions) in Kotlin.
4+
Learn about [lambdas](https://kotlinlang.org/docs/lambdas.html#lambda-expressions-and-anonymous-functions) in Kotlin.
55

66
Pass a lambda to the [`any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/any.html)
77
function to check if the collection contains an even number.

Introduction/Named arguments/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Make the function `joinOptions()` return the list in a JSON format (e.g., `[a, b, c]`)
44
by specifying only two arguments.
55

6-
[Default and named](https://kotlinlang.org/docs/reference/functions.html#default-arguments)
6+
[Default and named](https://kotlinlang.org/docs/functions.html#default-arguments)
77
arguments help to minimize the number of overloads and improve the readability of the function invocation.
88
The library function [`joinToString`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/join-to-string.html)
99
is declared with default values for parameters:

Introduction/Nothing type/task.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
## Nothing type
22

3-
[Nothing type](https://kotlinlang.org/docs/reference/exceptions.html#the-nothing-type)
3+
[Nothing type](https://kotlinlang.org/docs/exceptions.html#the-nothing-type)
44
can be used as a return type for a function that always throws an exception.
5-
When you call such a function, the compiler uses the information that it throws an exception.
5+
When you call such a function, the compiler uses the information that the execution doesn't continue beyond the function.
66

77
Specify `Nothing` return type for the `failWithWrongAge` function.
88
Note that without the `Nothing` type the `checkAge` function doesn't compile

Introduction/Nullable types/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Nullable types
22

33
Learn about
4-
[null safety and safe calls](https://kotlinlang.org/docs/reference/null-safety.html)
4+
[null safety and safe calls](https://kotlinlang.org/docs/null-safety.html)
55
in Kotlin and rewrite the following Java code so that it only has one `if` expression:
66

77
```java

Introduction/Triple-quoted strings/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Triple-quoted strings
22

3-
Learn about the [different string literals and string templates](https://kotlinlang.org/docs/reference/basic-types.html#string-literals)
3+
Learn about the [different string literals and string templates](https://kotlinlang.org/docs/basic-types.html#string-literals)
44
in Kotlin.
55

66
You can use the handy library functions

Properties/Delegates examples/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
## Delegates example
22

3-
Learn about [delegated properties](https://kotlinlang.org/docs/reference/delegated-properties.html)
3+
Learn about [delegated properties](https://kotlinlang.org/docs/delegated-properties.html)
44
and make the property lazy using delegates.

Properties/Delegates how it works/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Delegates
22

3-
You can declare your own [delegates](https://kotlinlang.org/docs/reference/delegated-properties.html#property-delegate-requirements).
3+
You can declare your own [delegates](https://kotlinlang.org/docs/delegated-properties.html#property-delegate-requirements).
44
Implement the methods of the class `EffectiveDate` so you can delegate to it.
55
Store only the time in milliseconds in the `timeInMillis` property.
66

Properties/Properties/task.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Properties
22

3-
Learn about the [properties](https://kotlinlang.org/docs/reference/properties.html) in Kotlin.
3+
Learn about the [properties](https://kotlinlang.org/docs/properties.html) in Kotlin.
44

55
Add a custom setter to `PropertyExample.propertyWithCounter` so that
66
the `counter` property is incremented every time the `propertyWithCounter` is assigned.

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildscript {
2-
ext.kotlin_version = '1.4.10'
2+
ext.kotlin_version = '1.5.10'
33

44
repositories {
55
mavenCentral()

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Wed Jun 26 18:26:37 CEST 2019
2-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3-all.zip
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
33
distributionBase=GRADLE_USER_HOME
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)