-
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
implement hw1 #765
base: master
Are you sure you want to change the base?
implement hw1 #765
Conversation
end | ||
|
||
row = PrintPascalTriangle.new | ||
row.printTriangle |
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.
Final newline missing.
end | ||
end | ||
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.
Trailing whitespace detected.
|
||
def printTriangle | ||
max = calculatedRow.flatten.max.to_s.length | ||
strings = calculatedRow.map {|arr| arr.map {|int| int.to_s.center(max + 3)} } |
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 between { and | missing.
Space missing inside }.
Line is too long. [81/80]
triangle | ||
end | ||
|
||
def printTriangle |
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 snake_case for method names.
end | ||
triangle | ||
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.
Trailing whitespace detected.
triangle = [] | ||
@rows.times do |row| | ||
line = [1] | ||
(0..row-1).each {|x| line << (line[x] * (row-x) / (x+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.
Surrounding space missing for operator -.
Space between { and | missing.
Surrounding space missing for operator +.
@rows = gets.chomp.to_i | ||
end | ||
|
||
def calculatedRow |
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 snake_case for method names.
print "Enter the depth of the triangle n = " | ||
@rows = gets.chomp.to_i | ||
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.
Trailing whitespace detected.
class PrintPascalTriangle | ||
def initialize | ||
print "Enter the depth of the triangle n = " | ||
@rows = gets.chomp.to_i |
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.
@@ -0,0 +1,27 @@ | |||
class PrintPascalTriangle | |||
def initialize | |||
print "Enter the depth of the triangle 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.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
end | ||
end | ||
row = PrintPascalTriangle.new | ||
row.printTriangle |
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.
unexpected token $end
end | ||
|
||
row = PrintPascalTriangle.new | ||
row.printTriangle |
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.
unexpected token $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.
ОТСТУПЫ
подозрение в плагиате #766 вот только сложно сказать кто у кого. |
Фамилия Имя
Слепенков Дмитрий
Email
[email protected]
Номер домашнего задания
1
Ссылка на видео с демо работы
https://youtu.be/i-HFvOaUZyg