From 4cb5eabb4882ffa120643fb9bad7addadcb24b1d Mon Sep 17 00:00:00 2001 From: stephen-hero <78870893+stephen-hero@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:15:03 +0300 Subject: [PATCH] Update task.md language checked --- duckShopServer/duckShopServerAddElements/task.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/duckShopServer/duckShopServerAddElements/task.md b/duckShopServer/duckShopServerAddElements/task.md index ed51f34..f1a0689 100644 --- a/duckShopServer/duckShopServerAddElements/task.md +++ b/duckShopServer/duckShopServerAddElements/task.md @@ -1,4 +1,4 @@ -In this task you need to implement functions to be able to +In this task, you need to implement functions to be able to add ducks to the Duck Shop. ### Task @@ -7,10 +7,10 @@ Implement three versions of the `addRandomDuck` function from the `GameChangeFun the `org.jetbrains.kotlin.course.duck.shop.functions.change` package. These functions should add a random duck from a list, set, or a map. -Note, you need _actually_ to add a new duck, it means for the cases with a set and a map you +Note, you need to _actually_ add a new duck, which means that in the cases with a set and a map, you need to generate a duck that is not present in the collection and add it. -After implementing this task the `Add` button in all three modes becomes alive: +After implementing this task, the `Add` button in all three modes becomes alive: ![Current state](../../utils/src/main/resources/images/duck/shop/states/state_5.gif) @@ -22,7 +22,7 @@ If you have any difficulties, **hints will help you solve this task**.
-To add a new item you can use the `add` built-in function: +To add a new item, you can use the built-in `add` function: ```kotlin val listOfNumbers = mutableListOf(1, 2, 3) listOfNumbers.add(4) @@ -33,7 +33,7 @@ setOfNumbers.add(4) println(setOfNumbers) // 1, 2, 3, 4 ``` -Note, that if you try to add the _same_ element to the set, it will not be added. +Note that if you try to add the _same_ element to the set, it will not be added.
@@ -45,9 +45,9 @@ myMap[3] = "three" println(myMap) // 1 to "one", 2 to "two", 3 to "three" ``` -In this case if you try to use an existing key, the old key will be replaced with the new one. +In this case, if you try to use an existing key, the old key will be replaced with the new one. -If you need to put something only if it is absent, you can use the `putIfAbsent` built-in function: +If you need to put something only if it is absent, you can use the built-in `putIfAbsent` function: ```kotlin val myMap = mutableMapOf(1 to "one", 2 to "two") myMap.putIfAbsent(3, "three") @@ -58,7 +58,7 @@ println(myMap) // 1 to "one", 2 to "two", 3 to "three"
-You can use the `minus` built-in function, to make the call more efficient convert one of the argument to the set: +You can use the built-in `minus` function to make the call more efficient and convert one of the arguments of the set: ```kotlin val listOfNumbers1 = listOf(1, 2, 3, 4, 5) val listOfNumbers2 = listOf(1, 2, 3)