Skip to content

Commit

Permalink
Update task.md
Browse files Browse the repository at this point in the history
language checked
  • Loading branch information
stephen-hero authored Sep 25, 2023
1 parent 281508c commit 20fdcec
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions duckShopServer/DuckShopServerDuckMapInitialization/task.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
In this task you need to implement a
In this task, you need to implement a
function to be able to initialize a map of random ducks in the Duck Shop.

### Task

Implement `generateMapOfDucks` function from the `GameModeService` class in
Implement the `generateMapOfDucks` function from the `GameModeService` class in
the `org.jetbrains.kotlin.course.duck.shop.mode` package.
This function should generate a new map with `MAX_NUMBER_OF_DUCKS` random ducks,
as a value for each duck you need to use `getDescription` function from the `Duck.kt` file.
This function should generate a new map with `MAX_NUMBER_OF_DUCKS` random ducks.
For the value of each duck, you need to use the `getDescription` function from the `Duck.kt` file.

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 `Map` button becomes alive:
After implementing this task, the `Map` button becomes alive:

![Current state](../../utils/src/main/resources/images/duck/shop/states/state_3.gif)

Expand All @@ -23,7 +23,7 @@ If you have any difficulties, **hints will help you solve this task**.

<div class="hint" title="How to create a map from a list?">

You can use the [`associateWith`]("https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/associate-with.html) built-in function to associate each item from list with a value and create a map:
You can use the built-in [`associateWith`]("https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/associate-with.html) function to associate each item from the list with a value and create a map:

```kotlin
val l = listOf("cat", "dog", "rabbit")
Expand Down

0 comments on commit 20fdcec

Please sign in to comment.