Skip to content

Commit

Permalink
Fix English
Browse files Browse the repository at this point in the history
  • Loading branch information
nbirillo committed Sep 28, 2024
1 parent 8afb699 commit 587265e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CookingService {
// task#2
fun cookWithSpices() {
val spices = generateSpices()
addSpecies(spices)
addSpices(spices)
pot.simmer()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fun cookSoup() {
fun generateSpices(): Sequence<SpiceType> = generateSequence { SpiceType.entries.random() }

// task#2
fun addSpecies(spices: Sequence<SpiceType>) {
fun addSpices(spices: Sequence<SpiceType>) {
val howMuchToAdd = Random.nextInt(1, 5)
spices
.map { shelf.getSpice(it) }
Expand Down
4 changes: 2 additions & 2 deletions culinaryServer/culinaryServerTask1/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ Consider examples for both cases. Let's imagine that we need to generate a seque
We can use [`generateSequence`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/generate-sequence.html) function with a condition inside:

```kotlin
val species = generateSequence{ shelfWithSpecies.getNextValidOne(...) }
val spices = generateSequence{ shelfWithSpices.getNextValidOne(...) }
```

In this case we will not actually have these `species`, `shelfWithSpecies.getNextValidOne(...)` will be called each time when it will be necessary, i.e. when we will actually need the next jar of species.
In this case we will not actually have these `spices`, `shelfWithSpices.getNextValidOne(...)` will be called each time when it will be necessary, i.e. when we will actually need the next jar of species.
For example, if for each jar of species we need to add it into the soup and we want to add only 3 different species, it will be done in the following way:

![Current state](TODO: a picture where we get and handle each piece step by step)
Expand Down

0 comments on commit 587265e

Please sign in to comment.