Skip to content

Conversation

@Serg-Lapata
Copy link

Фамилия Имя

Сергей Лапата

Email

Sovichh@yandex.ru

Номер домашнего задания

1

Ссылка на видео с демо работы

https://www.youtube.com/watch?v=ecIWPzGEbFc

width_element = rows.last.max.to_s.length + 1
width_last_row = width_element * rows.last.length

rows.each.with_index do |row, row_number|

Choose a reason for hiding this comment

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

Inconsistent indentation detected.


def print_triangle(rows)[]
width_element = rows.last.max.to_s.length + 1
width_last_row = width_element * rows.last.length

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

end

def print_triangle(rows)[]
width_element = rows.last.max.to_s.length + 1

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

check_integer(int.to_i)
end

def print_triangle(rows)[]

Choose a reason for hiding this comment

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

Literal [] used in void context.

end

def check_integer(int)
int < 1 ? raise('Got invalid number') : int.positive? ? int : raise('Got invalid number')

Choose a reason for hiding this comment

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

Ternary operators must not be nested. Prefer if or else constructs instead.
Line is too long. [91/80]

end

def check_integer(int)
int.positive? ? int : raise('Got invalid number')

Choose a reason for hiding this comment

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

Use 2 (not 0) spaces for indentation.

end

def check_integer(int)
int.positive? ? int : raise('Got invalid number')

Choose a reason for hiding this comment

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

Use 2 (not 1) spaces for indentation.

current_value = start_value
row = [current_value]
k = 1
row_number.times do
Copy link
Contributor

Choose a reason for hiding this comment

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

а почему бы аналог k переменной не передать в блок? Ведь times это может и тогда этот вот k = 1 можно будет убрать

Copy link
Contributor

@Xanderwot Xanderwot left a comment

Choose a reason for hiding this comment

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

Видео с демо работы прям не проверял видимо.

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