Skip to content

Козельских_ДЗ первой недели#37

Open
gipercube wants to merge 3 commits into
RTF-TypeScript-2021:devfrom
gipercube:kozelskikh_aleksandr
Open

Козельских_ДЗ первой недели#37
gipercube wants to merge 3 commits into
RTF-TypeScript-2021:devfrom
gipercube:kozelskikh_aleksandr

Conversation

@gipercube
Copy link
Copy Markdown

No description provided.

Comment thread topic-1/task-1/index.js
function isTriangle(a, b, c) {
isTriangle(7, 2, 2)
function isTriangle(a, b, c) {
if (a + b > c && a + c > b && b + c > a) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 целочисленных значения
добавить валидацию входных аргументов

Comment thread topic-1/task-2/index.js
calculateDoubleArray(array)

function calculateDoubleArray(array) {
for (let i = 0; i < array.length; i++) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

добавить проверку входного массива на корректность

Comment thread topic-1/task-2/index.js
i++
}
}
return array
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calculateDoubleArray([1, 2, 3, 4, 5]) - вернёт тот же результат что и [1, 2, 3, 4, 5, 0, 0, 0, 0, 0].
Добавить логику проверки для свободных ячеек.

Comment thread topic-1/task-3/index.js
*/

function factorial(n) {
if (n > 0) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нет проверки, что входной аргумент число, и что оно целое

Comment thread topic-1/task-4/index.js
* */

function countUniqueName(nameArray) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
добавить проверку входных данных

Comment thread topic-1/task-5/index.js
function kaprekarConstant(number){

function kaprekarConstant(number) {
let countDigits = number.toString().length;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kaprekarConstant(2223) - зависает. Добавить обработку входных данных

Comment thread topic-1/task-5/index.js
throw new Error('Число не должно состоять из одинаковых цифр.')
}
} else {
throw new Error('Число не из 4-х цифр.')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
думаю можно уточнить условие проверки)

https://www.dcode.fr/kaprekar-algorithm - я тестил тут

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants