From 66a1f4c7d67ecf7b24569eea0bf0ce7dba06e1e4 Mon Sep 17 00:00:00 2001 From: Nikolay Gagarinov Date: Wed, 10 Jun 2026 19:30:57 +0500 Subject: [PATCH] remove(45-logic): delete 15-predicates lesson to sync with Python course MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Урок дублировал раздел «Предикаты» в 10-bool-type (порт из Python), а его упражнение isMister дублировало тему 17-bool-strings. Уникальные примеры имён предикатов перенесены в 10-bool-type. Записи в ignored_languagetool_errors вычищены. Co-Authored-By: Claude Fable 5 --- modules/45-logic/10-bool-type/ru/README.md | 2 + modules/45-logic/15-predicates/Makefile | 2 - .../45-logic/15-predicates/description.es.yml | 56 ----------- modules/45-logic/15-predicates/en/EXERCISE.md | 9 -- modules/45-logic/15-predicates/en/README.md | 32 ------- modules/45-logic/15-predicates/en/data.yml | 9 -- modules/45-logic/15-predicates/es/EXERCISE.md | 9 -- modules/45-logic/15-predicates/es/README.md | 31 ------ modules/45-logic/15-predicates/es/data.yml | 10 -- modules/45-logic/15-predicates/index.js | 5 - modules/45-logic/15-predicates/ru/EXERCISE.md | 9 -- modules/45-logic/15-predicates/ru/README.md | 31 ------ modules/45-logic/15-predicates/ru/data.yml | 9 -- modules/45-logic/15-predicates/test.js | 8 -- modules/ignored_languagetool_errors | 94 ------------------- 15 files changed, 2 insertions(+), 314 deletions(-) delete mode 100644 modules/45-logic/15-predicates/Makefile delete mode 100644 modules/45-logic/15-predicates/description.es.yml delete mode 100644 modules/45-logic/15-predicates/en/EXERCISE.md delete mode 100644 modules/45-logic/15-predicates/en/README.md delete mode 100644 modules/45-logic/15-predicates/en/data.yml delete mode 100644 modules/45-logic/15-predicates/es/EXERCISE.md delete mode 100644 modules/45-logic/15-predicates/es/README.md delete mode 100644 modules/45-logic/15-predicates/es/data.yml delete mode 100644 modules/45-logic/15-predicates/index.js delete mode 100644 modules/45-logic/15-predicates/ru/EXERCISE.md delete mode 100644 modules/45-logic/15-predicates/ru/README.md delete mode 100644 modules/45-logic/15-predicates/ru/data.yml delete mode 100644 modules/45-logic/15-predicates/test.js diff --git a/modules/45-logic/10-bool-type/ru/README.md b/modules/45-logic/10-bool-type/ru/README.md index 2c1b2b5e..efb31572 100644 --- a/modules/45-logic/10-bool-type/ru/README.md +++ b/modules/45-logic/10-bool-type/ru/README.md @@ -61,3 +61,5 @@ const isNegative = (number) => number < 0; console.log(isNegative(-5)); // => true console.log(isNegative(7)); // => false ``` + +Имена предикатов строят так, чтобы вопрос читался прямо из названия: `hasChildren()` — «есть ли дети?», `isEmpty()` — «пустая ли строка?», `hasErrors()` — «есть ли ошибки?». При этом предикатом считается только функция, которая возвращает именно логическое значение — без исключений. diff --git a/modules/45-logic/15-predicates/Makefile b/modules/45-logic/15-predicates/Makefile deleted file mode 100644 index d0d0a48c..00000000 --- a/modules/45-logic/15-predicates/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -test: - @ test.sh diff --git a/modules/45-logic/15-predicates/description.es.yml b/modules/45-logic/15-predicates/description.es.yml deleted file mode 100644 index a21c4735..00000000 --- a/modules/45-logic/15-predicates/description.es.yml +++ /dev/null @@ -1,56 +0,0 @@ ---- - -name: Predicados -theory: | - - Recordemos la función `isInfant()` del tema anterior: - - ```javascript - const isInfant = (age) => age < 1; - console.log(isInfant(3)); - ``` - ```textfalse``` - - - Estas funciones se llaman funciones booleanas. Los boolenos (o funciones de pregunta) responden a una pregunta y siempre (¡sin excepciones!) devuelven `true` o `false`. - - En todos los lenguajes, los predicados se nombran de manera especial para facilitar el análisis. En JavaScript, los predicados generalmente comienzan con los prefijos `is`, `has` o `can`, pero no se limitan a estas palabras. Ejemplos: - - * `isInfant()` - "¿es un bebé?" - * `hasChildren()` - "¿tiene hijos?" - * `isEmpty()` - "¿está vacío?" - * `hasErrors()` - "¿tiene errores?" - - Una función solamente puede considerarse booleana **siempre y cuando** devuelva un valor booleano. - - --- - - Ahora escribamos otra función booleana. Toma una cadena y verifica si es la palabra `'Castle'`: - - ```javascript - const isCastle = (type) => type === 'Castle'; - - console.log(isCastle('Sea')); - ``` - - ```textfalse``` - - -instructions: | - - Escriba una función `isMister()` que tome una cadena y verifique si es la palabra `'Mister'`. - - Ejemplos de llamadas: - - ```javascript - isMister('Mister'); // true - isMister('Miss'); // false - ``` - -tips: - - | - [Naming en programación](https://codica.la/blog/naming-in-programming) - -definitions: - - name: "Predicado" - description: "una expresión que responde a una pregunta con 'sí' o 'no' utilizando el tipo booleano." diff --git a/modules/45-logic/15-predicates/en/EXERCISE.md b/modules/45-logic/15-predicates/en/EXERCISE.md deleted file mode 100644 index 25f20572..00000000 --- a/modules/45-logic/15-predicates/en/EXERCISE.md +++ /dev/null @@ -1,9 +0,0 @@ - -Write the function `isMister()` that takes a string and checks if it's the word `'Mister'`. - -Examples: - -```javascript -isMister('Mister'); // true -isMister('Miss'); // false -``` diff --git a/modules/45-logic/15-predicates/en/README.md b/modules/45-logic/15-predicates/en/README.md deleted file mode 100644 index d50f9ca4..00000000 --- a/modules/45-logic/15-predicates/en/README.md +++ /dev/null @@ -1,32 +0,0 @@ - -Remember the `isInfant()` function from the last lesson: - -```javascript -const isInfant = (age) => age < 1; -console.log(isInfant(3)); -``` - -```textfalse``` - -This kind of function is called a predicate. Predicate functions answer a question and always (without exception!) return either `true` or `false`. - -Predicates usually have handy names in every language for simplicity of analysis. In JavaScript, predicates generally begin with `is`, `has`, or `can`, though it's not limited to just those words. Examples: - - * `isInfant()` - "is he an infant?" - * `hasChildren()` - "does he have children?" - * `isEmpty()` - "is it empty?" - * `hasErrors()` - "are there any errors?" - -**Only** a function returning a boolean can be considered a predicate. - ---- - -Let's write one more predicate function. It takes a string and checks if it's the word `'Castle'`: - -```javascript -const isCastle = (type) => type === 'Castle'; - -console.log(isCastle('Sea')); -``` - -```textfalse``` diff --git a/modules/45-logic/15-predicates/en/data.yml b/modules/45-logic/15-predicates/en/data.yml deleted file mode 100644 index a021c3d8..00000000 --- a/modules/45-logic/15-predicates/en/data.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -name: Predicates -tips: - - > - [Naming In - Programming](https://en.hexlet.io/blog/posts/code-complete-naming-in-programming) -definitions: - - name: Predicate - description: is an expression that answers a yes or no question with a boolean. diff --git a/modules/45-logic/15-predicates/es/EXERCISE.md b/modules/45-logic/15-predicates/es/EXERCISE.md deleted file mode 100644 index 82e996e0..00000000 --- a/modules/45-logic/15-predicates/es/EXERCISE.md +++ /dev/null @@ -1,9 +0,0 @@ - -Escriba una función `isMister()` que tome una cadena y verifique si es la palabra `'Mister'`. - -Ejemplos de llamadas: - -```javascript -isMister('Mister'); // true -isMister('Miss'); // false -``` diff --git a/modules/45-logic/15-predicates/es/README.md b/modules/45-logic/15-predicates/es/README.md deleted file mode 100644 index 7c7ca505..00000000 --- a/modules/45-logic/15-predicates/es/README.md +++ /dev/null @@ -1,31 +0,0 @@ - -Recordemos la función `isInfant()` del tema anterior: - -```javascript -const isInfant = (age) => age < 1; -console.log(isInfant(3)); -``` -```textfalse``` - -Estas funciones se llaman funciones booleanas. Los boolenos (o funciones de pregunta) responden a una pregunta y siempre (¡sin excepciones!) devuelven `true` o `false`. - -En todos los lenguajes, los predicados se nombran de manera especial para facilitar el análisis. En JavaScript, los predicados generalmente comienzan con los prefijos `is`, `has` o `can`, pero no se limitan a estas palabras. Ejemplos: - - * `isInfant()` - "¿es un bebé?" - * `hasChildren()` - "¿tiene hijos?" - * `isEmpty()` - "¿está vacío?" - * `hasErrors()` - "¿tiene errores?" - -Una función solamente puede considerarse booleana **siempre y cuando** devuelva un valor booleano. - ---- - -Ahora escribamos otra función booleana. Toma una cadena y verifica si es la palabra `'Castle'`: - -```javascript -const isCastle = (type) => type === 'Castle'; - -console.log(isCastle('Sea')); -``` - -```textfalse``` diff --git a/modules/45-logic/15-predicates/es/data.yml b/modules/45-logic/15-predicates/es/data.yml deleted file mode 100644 index 8db0574e..00000000 --- a/modules/45-logic/15-predicates/es/data.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: Predicados -tips: - - | - [Naming en programación](https://codica.la/blog/naming-in-programming) -definitions: - - name: Predicado - description: >- - una expresión que responde a una pregunta con 'sí' o 'no' utilizando el - tipo booleano. diff --git a/modules/45-logic/15-predicates/index.js b/modules/45-logic/15-predicates/index.js deleted file mode 100644 index 7313d1f2..00000000 --- a/modules/45-logic/15-predicates/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// BEGIN -const isMister = (greeting) => greeting === 'Mister'; -// END - -export default isMister; diff --git a/modules/45-logic/15-predicates/ru/EXERCISE.md b/modules/45-logic/15-predicates/ru/EXERCISE.md deleted file mode 100644 index 7cc71d72..00000000 --- a/modules/45-logic/15-predicates/ru/EXERCISE.md +++ /dev/null @@ -1,9 +0,0 @@ - -Напишите функцию `isMister()`, которая принимает строку и проверяет, является ли она словом `'Mister'`. - -Примеры вызова: - -```javascript -isMister('Mister'); // true -isMister('Miss'); // false -``` diff --git a/modules/45-logic/15-predicates/ru/README.md b/modules/45-logic/15-predicates/ru/README.md deleted file mode 100644 index dc594859..00000000 --- a/modules/45-logic/15-predicates/ru/README.md +++ /dev/null @@ -1,31 +0,0 @@ - -Вспомним функцию `isInfant()` из прошлого урока: - -```javascript -const isInfant = (age) => age < 1; -console.log(isInfant(3)); -``` -```textfalse``` - -Подобные функции называют предикатами. Функции-предикаты (или функции-вопросы) отвечают на какой-то вопрос и всегда (без исключений!) возвращают либо `true`, либо `false`. - -Предикаты во всех языках принято именовать особым образом для простоты анализа. В JavaScript предикаты, как правило, начинаются с префикса `is`, `has` или `can`, но не ограничены этими словами. Примеры: - - * `isInfant()` — «младенец ли?» - * `hasChildren()` — «есть ли дети?» - * `isEmpty()` — «пустой ли?» - * `hasErrors()` — «есть ли ошибки?» - -Функция может считаться предикатом **только** если она возвращает boolean. - ---- - -Давайте напишем ещё одну функцию-предикат. Она принимает строку и проверяет, является ли она словом `'Castle'`: - -```javascript -const isCastle = (type) => type === 'Castle'; - -console.log(isCastle('Sea')); -``` - -```textfalse``` diff --git a/modules/45-logic/15-predicates/ru/data.yml b/modules/45-logic/15-predicates/ru/data.yml deleted file mode 100644 index 39495668..00000000 --- a/modules/45-logic/15-predicates/ru/data.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -name: Предикаты -tips: - - > - [Именование в - программировании](https://ru.hexlet.io/blog/posts/naming-in-programming) -definitions: - - name: Предикат - description: выражение, отвечающее на вопрос «да» или «нет» с помощью типа boolean. diff --git a/modules/45-logic/15-predicates/test.js b/modules/45-logic/15-predicates/test.js deleted file mode 100644 index 6f789f1a..00000000 --- a/modules/45-logic/15-predicates/test.js +++ /dev/null @@ -1,8 +0,0 @@ -import { expect, test } from 'vitest'; -import f from './index.js'; - -test('test', () => { - expect(f('8234782')).toBe(false); - expect(f('Joker')).toBe(false); - expect(f('Mister')).toBe(true); -}); diff --git a/modules/ignored_languagetool_errors b/modules/ignored_languagetool_errors index b16fbba0..a75b4623 100755 --- a/modules/ignored_languagetool_errors +++ b/modules/ignored_languagetool_errors @@ -367,24 +367,6 @@ Posible error tipográfico: múltiples espacios en blanco Posible error tipográfico: múltiples espacios en blanco Предлагаемые варианты: ------------------------- -45-logic/15-predicates/es/README.md:6:43:5 -... ```
false
https://replit.com/@hexlet/js-ba... -Si es pasado, se escribe con tilde. Si es imperativo, puede que falte una coma. -Предлагаемые варианты: - falsé, , false ------------------------- -45-logic/15-predicates/es/README.md:10:43:8 -...ones se llaman funciones booleanas. Los boolenos (o funciones de pregunta) responden a u... -Se ha encontrado un posible error ortográfico. -Предлагаемые варианты: -booleanos, bóllenos, viólenos ------------------------- -45-logic/15-predicates/es/README.md:28:43:5 -... ```
false
-Si es pasado, se escribe con tilde. Si es imperativo, puede que falte una coma. -Предлагаемые варианты: - falsé, , false ------------------------ 45-logic/10-bool-type/es/README.md:1:43:5 .... Esto se lee como una pregunta: "¿Es 5 mayor que 4?". En este caso, la respuesta es ... @@ -1548,10 +1530,6 @@ Ello, Sello, Bello, Huyó, Halló, Helio, Leyó, Hoyo, Selló, Vello, Huyo, Hall ...и запишем в переменную первый символ из строки-параметра 2. Сравним, равен ли символ своей больш... Возможно найдена орфографическая ошибка. ------------------------ -45-logic/15-predicates/ru/README.md:10:43:15 -...ают предикатами. Функции-предикаты (или функции-вопросы) отвечают на какой-то вопрос и всегда (... -Возможно найдена орфографическая ошибка. ------------------------- 45-logic/10-bool-type/ru/README.md:3:43:12 ...лько если они есть, нас пускают внутрь (авторизируют). Языки программирования адаптировали ... Возможно найдена орфографическая ошибка. @@ -1725,30 +1703,6 @@ Possible typo: you repeated a whitespace Possible typo: you repeated a whitespace Предлагаемые варианты: ------------------------- -45-logic/15-predicates/en/README.md:6:43:9 -...m the last lesson: ```javascript ```
false
Thi... -This word is normally spelled with a hyphen. -Предлагаемые варианты: -pre-class ------------------------- -45-logic/15-predicates/en/README.md:6:43:20 -...lesson: ```javascript ```
false
This kind of function is ... -Possible spelling mistake found. -Предлагаемые варианты: -hex let-basics-output ------------------------- -45-logic/15-predicates/en/README.md:26:43:9 -... it's the word ``: ```javascript ```
false
-This word is normally spelled with a hyphen. -Предлагаемые варианты: -pre-class ------------------------- -45-logic/15-predicates/en/README.md:26:43:20 -...ord ``: ```javascript ```
false
-Possible spelling mistake found. -Предлагаемые варианты: -hex let-basics-output ------------------------ 45-logic/10-bool-type/en/README.md:39:43:9 ...eturn that result. ```javascript ```
false
Now... @@ -2426,30 +2380,6 @@ Unpaired symbol: ‘"’ seems to be missing ...return the result of the equality check "*. Another example: write a function to... Unpaired symbol: ‘"’ seems to be missing ------------------------ -45-logic/15-predicates/en/README.md:6:43:9 -...m the last lesson: ```javascript ```
false
Thi... -This word is normally spelled with a hyphen. -Предлагаемые варианты: -pre-class ------------------------- -45-logic/15-predicates/en/README.md:6:43:20 -...lesson: ```javascript ```
false
This kind of function is ... -Possible spelling mistake found. -Предлагаемые варианты: -hex let-basics-output ------------------------- -45-logic/15-predicates/en/README.md:26:43:9 -... it's the word ``: ```javascript ```
false
-This word is normally spelled with a hyphen. -Предлагаемые варианты: -pre-class ------------------------- -45-logic/15-predicates/en/README.md:26:43:20 -...ord ``: ```javascript ```
false
-Possible spelling mistake found. -Предлагаемые варианты: -hex let-basics-output ------------------------- 45-logic/10-bool-type/en/README.md:39:43:9 ...eturn that result. ```javascript ```
false
Now... This word is normally spelled with a hyphen. @@ -3016,30 +2946,6 @@ Unpaired symbol: ‘"’ seems to be missing ...return the result of the equality check "*. Another example: write a function to... Unpaired symbol: ‘"’ seems to be missing ------------------------ -45-logic/15-predicates/en/README.md:6:43:9 -...m the last lesson: ```javascript ```
false
Thi... -This word is normally spelled with a hyphen. -Предлагаемые варианты: -pre-class ------------------------- -45-logic/15-predicates/en/README.md:6:43:20 -...lesson: ```javascript ```
false
This kind of function is ... -Possible spelling mistake found. -Предлагаемые варианты: -hex let-basics-output ------------------------- -45-logic/15-predicates/en/README.md:26:43:9 -... it's the word ``: ```javascript ```
false
-This word is normally spelled with a hyphen. -Предлагаемые варианты: -pre-class ------------------------- -45-logic/15-predicates/en/README.md:26:43:20 -...ord ``: ```javascript ```
false
-Possible spelling mistake found. -Предлагаемые варианты: -hex let-basics-output ------------------------- 45-logic/25-logical-operators/en/README.md:33:43:2 ... | |-------| ------|----------| | TRUE | TRUE | **TRUE** | | TRUE | FALSE | F... Possible typo: you repeated a whitespace