diff --git a/duckShopServer/DuckShopServerDuckSetInitialization/task.md b/duckShopServer/DuckShopServerDuckSetInitialization/task.md index e9b198e..87f3fb3 100644 --- a/duckShopServer/DuckShopServerDuckSetInitialization/task.md +++ b/duckShopServer/DuckShopServerDuckSetInitialization/task.md @@ -1,16 +1,16 @@ -In this task you need to implement a function +In this task, you need to implement a function to be able to initialize a set of random ducks in the Duck Shop. ### Task -Implement `generateSetOfDucks` function from the `GameModeService` class in +Implement the `generateSetOfDucks` function from the `GameModeService` class in the `org.jetbrains.kotlin.course.duck.shop.mode` package. This function should generate a new set with `MAX_NUMBER_OF_DUCKS` random ducks. You can find the already defined variable `MAX_NUMBER_OF_DUCKS` in the `GameUtil.kt` file in the `org.jetbrains.kotlin.course.duck.shop.utils` package. -After implementing this task the `Set` button becomes alive: +After implementing this task, the `Set` button becomes alive: ![Current state](../../utils/src/main/resources/images/duck/shop/states/state_2.gif) @@ -27,10 +27,10 @@ If you need to shuffle a list of elements, you can use the built-in function [`s
-To take first `N` elements from the list, you can use the [`take`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/take.html) built-in function. -Note, since `List` is an ordered structure, you always will get first `N` elements. -To complete the task you can take the necessary amount of shuffled elements and convert the result into a set. -Since the `Duck` enum has only different value, the resulting size of the set will be the same with the list size. +To get the first `N` elements of the list, you can use the built-in [`take`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/take.html) function. +Note, since `List` is an ordered structure, you will always get the first `N` elements. +To complete the task, you can take the necessary number of shuffled elements and convert the result into a set. +Since the `Duck` enum has only different values, the resulting size of the set will be the same as the list size.