Skip to content

Commit

Permalink
Add pictures
Browse files Browse the repository at this point in the history
  • Loading branch information
nbirillo committed Sep 30, 2024
1 parent b7acf6b commit 6587287
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions culinaryServer/culinaryServerListSequenceTheory/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ To ook this sup, we need to pull tomatoes from the fridge, put them into the kit
If we work with a _list_ of tomatoes, then we will do it exactly as we described,
since we will be working with all the tomatoes per action, e.g., get all tomatoes, then cut all the tomatoes, etc:

![Current state](TODO: picture that describes this process)
![Current state](../../utils/src/main/resources/images/master/chef/explanations/soup_cooking_list.png)

If we work with a _sequence_ of tomatoes, then we will handle each tomato separately until we get the necessary number of tomatoes, e.g.
we will get one tomatoe, put it into the kitchen, cut it, put into the pot. Then we will repeat this action with the next tomato, and etc:

![Current state](TODO: picture that describes this process)
![Current state](../../utils/src/main/resources/images/master/chef/explanations/soup_cooking_sequence.png)

The first approach works good in the case, when you have enough space in the kitchen, but if you don't,
probably the second one will be better - since it cn handle a long _sequence_ of tomatoes with a limited space in the kitchen.

![Current state](TODO: picture 1 case when many tomatoes and do not have enough space on the table)
![Current state](../../utils/src/main/resources/images/master/chef/explanations/soup_cooking_no_space.png)

This way of computing is called `lazy computing` and it is the main idea of the sequences.
4 changes: 2 additions & 2 deletions culinaryServer/culinaryServerSequenceInitialization/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ val spices = generateSequence{ shelfWithSpices.getNextValidOne(...) }
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)
![Current state](../../utils/src/main/resources/images/master/chef/explanations/soup_cooking_spices.png)

Consider the second example. A _terminal_ function is necessary to show the Kotlin compiler, that you actually ready to proceed with the actions, e.g. `take(5)` or `toList()` for finite sequences.
From the example above, if we don't use `take(5)` and in theory have infinite shelf, we will not be able to handle all of them, we do have limited resources on our laptop (or in a pot from the example).

![Current state](TODO: a picture - limited size of the pot, and we cannot handle all of them)
![Current state](../../utils/src/main/resources/images/master/chef/explanations/soup_cooking_spices_no_space.png)
2 changes: 1 addition & 1 deletion culinaryServer/lesson-info.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
type: framework
custom_name: Master chef
is_template_based: false
content:
- culinaryServerIntroduction
- culinaryServerHowToRun
Expand All @@ -12,3 +11,4 @@ content:
- culinaryServerAddSpices
- culinaryServerCookSalad
- culinaryServerCookSmoothie
is_template_based: false
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6587287

Please sign in to comment.