diff --git a/en/news/2020-02-11_teaching-programming-2019.md b/en/news/2020-02-11_teaching-programming-2019.md index 1c5703d..85d185d 100644 --- a/en/news/2020-02-11_teaching-programming-2019.md +++ b/en/news/2020-02-11_teaching-programming-2019.md @@ -176,7 +176,7 @@ Let's look closer: 1. The function accepts `world` (dictionary) that is used by functions to communicate with each other. `world` consists of three regions (dictionary keys): * `state` contains variable data used for communication; * `settings` contain constants to configure functions; - * `events` contain publishers to be able to subscribe functions to events. + * `events` contain [publishers][pub-sub] to be able to subscribe functions to events. 1. An instance of this constructor function is created with `new` operator while parsing `последовательность` module. Practically, everything outside of `run` method is considered to be part of the constructor body. In our case, we create `spheres hidden` variable to count hidden spheres. 1. `run` method is executed each time an event is reported. 1. Since `check for ending` reaction is executed each time a user hides a pair of spheres, we increase `spheres hidden` counter by `2`. @@ -295,3 +295,4 @@ I'll share answers to these and other questions next year ;) [screenshot-group]: ../../images/2020-02-11_teaching-to-program-2019_group.jpg [isomorphic-git]: https://isomorphic-git.org/ [swiftui]: https://www.hackingwithswift.com/quick-start/swiftui/what-is-swiftui +[pub-sub]: https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern diff --git a/en/news/teaching-to-program-2019.html b/en/news/teaching-to-program-2019.html index 6266bec..f58acd3 100644 --- a/en/news/teaching-to-program-2019.html +++ b/en/news/teaching-to-program-2019.html @@ -237,7 +237,7 @@ The class had almost an empty последовательность
  • The function accepts world (dictionary) that is used by functions to communicate with each other. world consists of three regions (dictionary keys):
  • +
  • events contain publishers to be able to subscribe functions to events.
  • An instance of this constructor function is created with new operator while parsing последовательность module. Practically, everything outside of run method is considered to be part of the constructor body. In our case, we create spheres hidden variable to count hidden spheres.
  • run method is executed each time an event is reported.
  • Since check for ending reaction is executed each time a user hides a pair of spheres, we increase spheres hidden counter by 2.
  • diff --git a/ru/news/2020-02-11_teaching-programming-2019.md b/ru/news/2020-02-11_teaching-programming-2019.md index 3c796b9..5f57a33 100644 --- a/ru/news/2020-02-11_teaching-programming-2019.md +++ b/ru/news/2020-02-11_teaching-programming-2019.md @@ -145,7 +145,7 @@ function ПроверитьОкончание(мир) // 1. 1. Функция принимает на вход `мир` (словарь), используемый для общения функций друг с другом. `мир` состоит из трёх областей (ключей словаря): * `состояние` содержит переменные значения для обмена данными; * `настройки` содержат константные значения для настройки функций; - * `события` содержат издателей для организации возможности подписать функции на события. + * `события` содержат [издателей][pub-sub] для организации возможности подписать функции на события. 1. Экземпляр функции-конструктора создаётся оператором `new` при разборе модуля `последовательность`. Фактически всё, что не входит в метод `исполнить`, является телом конструктора. В частности, здесь мы создаём переменную `скрыто сфер` для учёта количества скрытых сфер. 1. Метод `исполнить` вызывается на каждое уведомление о событии. 1. Т.к. реакцию `проверить окончание` вызывают на событие сокрытия пары сфер, то счётчик `скрыто сфер` увеличиваем на `2`. @@ -251,3 +251,4 @@ console.log(кот); [screenshot-group]: ../../images/2020-02-11_teaching-to-program-2019_group.jpg [isomorphic-git]: https://isomorphic-git.org/ [swiftui]: https://medium.com/someswift/swiftui-dsl-%D0%BD%D0%B0-%D0%BC%D0%B0%D0%BA%D1%81%D0%B8%D0%BC%D0%B0%D0%BB%D0%BA%D0%B0%D1%85-891741685efe +[pub-sub]: https://ru.wikipedia.org/wiki/%D0%98%D0%B7%D0%B4%D0%B0%D1%82%D0%B5%D0%BB%D1%8C-%D0%BF%D0%BE%D0%B4%D0%BF%D0%B8%D1%81%D1%87%D0%B8%D0%BA_(%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD_%D0%BF%D1%80%D0%BE%D0%B5%D0%BA%D1%82%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F) diff --git a/ru/news/teaching-to-program-2019.html b/ru/news/teaching-to-program-2019.html index 039a42c..4cc528e 100644 --- a/ru/news/teaching-to-program-2019.html +++ b/ru/news/teaching-to-program-2019.html @@ -215,7 +215,7 @@
  • Функция принимает на вход мир (словарь), используемый для общения функций друг с другом. мир состоит из трёх областей (ключей словаря):
  • +
  • события содержат издателей для организации возможности подписать функции на события.
  • Экземпляр функции-конструктора создаётся оператором new при разборе модуля последовательность. Фактически всё, что не входит в метод исполнить, является телом конструктора. В частности, здесь мы создаём переменную скрыто сфер для учёта количества скрытых сфер.
  • Метод исполнить вызывается на каждое уведомление о событии.
  • Т.к. реакцию проверить окончание вызывают на событие сокрытия пары сфер, то счётчик скрыто сфер увеличиваем на 2.