-
Notifications
You must be signed in to change notification settings - Fork 165
implement hw 1 #773
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
base: master
Are you sure you want to change the base?
implement hw 1 #773
Conversation
2018/KuikoIhar/1/pas_tri.rb
Outdated
| puts "Введите базовый номер: " | ||
| n = gets.chomp.to_i | ||
| puts center lines pas_tri(h, n) | ||
|
|
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.
1 trailing blank lines detected.
2018/KuikoIhar/1/pas_tri.rb
Outdated
|
|
||
| puts "Введите глубину дерева: " | ||
| h = gets.chomp.to_i | ||
| puts "Введите базовый номер: " |
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.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
2018/KuikoIhar/1/pas_tri.rb
Outdated
| end | ||
|
|
||
|
|
||
| puts "Введите глубину дерева: " |
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.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
2018/KuikoIhar/1/pas_tri.rb
Outdated
| l.map{|s| pad(s, n)} | ||
| end | ||
|
|
||
|
|
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.
Extra blank line detected.
2018/KuikoIhar/1/pas_tri.rb
Outdated
|
|
||
| def center (l) | ||
| n = l[-1].size | ||
| l.map{|s| pad(s, n)} |
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.
Space missing to the left of {.
Space between { and | missing.
Space missing inside }.
2018/KuikoIhar/1/pas_tri.rb
Outdated
|
|
||
| def pad (s, n) | ||
| l = n - s.size | ||
| ' '*(l/2) + s + ' '*(l-l/2) |
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.
Surrounding space missing for operator *.
Surrounding space missing for operator /.
Surrounding space missing for operator -.
2018/KuikoIhar/1/pas_tri.rb
Outdated
| end | ||
| end | ||
|
|
||
| def pad (s, n) |
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.
Do not put a space between a method name and the opening parenthesis.
2018/KuikoIhar/1/pas_tri.rb
Outdated
| def pas_tri (h, n) | ||
| l = [n] | ||
| [l] + (1..h).map do | ||
| l = [n] + l[1..-1].map.with_index{|x, i| x+l[i]} + [n] |
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.
Space missing to the left of {.
Space between { and | missing.
Surrounding space missing for operator +.
Space missing inside }.
2018/KuikoIhar/1/pas_tri.rb
Outdated
| @@ -0,0 +1,33 @@ | |||
| #!/usr/bin/env ruby | |||
|
|
|||
| def pas_tri (h, n) | |||
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.
Do not put a space between a method name and the opening parenthesis.
2018/KuikoIhar/1/pas_tri.rb
Outdated
| @@ -0,0 +1,33 @@ | |||
| #!/usr/bin/env ruby | |||
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.
Script file pas_tri.rb doesn't have execute permission.
2018/KuikoIhar/1/pas_tri.rb
Outdated
| def lines(rows) | ||
| n = rows[-1].max.to_s.size | ||
| rows.map do | ||
| |row| row.map { |x| pad(x.to_s, n) }.join(' ') |
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.
Block argument expression is not on the same line as the block start.
2018/KuikoIhar/1/pas_tri.rb
Outdated
|
|
||
| def lines(rows) | ||
| n = rows[-1].max.to_s.size | ||
| rows.map 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.
Trailing whitespace detected.
Xanderwot
left a comment
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.
избегай однобуквенных переменных. читать код очень сложно
Xanderwot
left a comment
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
coooll81@tut.by
Номер домашнего задания
1
Ссылка на видео с демо работы
https://youtu.be/E1GFcHwCDhI
Комментарии
с 3 уровнем ещё разбираюсь