-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
homework 1 #771
base: master
Are you sure you want to change the base?
homework 1 #771
Conversation
2018/Serg-Lapata/hw-1/task.rb
Outdated
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| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation detected.
2018/Serg-Lapata/hw-1/task.rb
Outdated
|
||
def print_triangle(rows)[] | ||
width_element = rows.last.max.to_s.length + 1 | ||
width_last_row = width_element * rows.last.length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation detected.
2018/Serg-Lapata/hw-1/task.rb
Outdated
end | ||
|
||
def print_triangle(rows)[] | ||
width_element = rows.last.max.to_s.length + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation detected.
2018/Serg-Lapata/hw-1/task.rb
Outdated
check_integer(int.to_i) | ||
end | ||
|
||
def print_triangle(rows)[] |
There was a problem hiding this comment.
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.
2018/Serg-Lapata/hw-1/task.rb
Outdated
end | ||
|
||
def check_integer(int) | ||
int < 1 ? raise('Got invalid number') : int.positive? ? int : raise('Got invalid number') |
There was a problem hiding this comment.
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]
2018/Serg-Lapata/hw-1/task.rb
Outdated
end | ||
|
||
def check_integer(int) | ||
int.positive? ? int : raise('Got invalid number') |
There was a problem hiding this comment.
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.
2018/Serg-Lapata/hw-1/task.rb
Outdated
end | ||
|
||
def check_integer(int) | ||
int.positive? ? int : raise('Got invalid number') |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а почему бы аналог k переменной не передать в блок? Ведь times это может и тогда этот вот k = 1 можно будет убрать
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Видео с демо работы прям не проверял видимо.
Фамилия Имя
Сергей Лапата
Email
[email protected]
Номер домашнего задания
1
Ссылка на видео с демо работы
https://www.youtube.com/watch?v=ecIWPzGEbFc