-
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 hw 1 #768
base: master
Are you sure you want to change the base?
implement hw 1 #768
Conversation
n = gets.chomp.to_i | ||
|
||
pascal(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.
k+=1} | ||
p tree} | ||
end | ||
print "Введите глубину дерева: " |
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.
base=base*(r-k+1)/k | ||
tree.push base | ||
k+=1} | ||
p tree} |
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.
Expression at 17, 11 should be on its own line.
(0..r-1).step(1){|index| | ||
base=base*(r-k+1)/k | ||
tree.push base | ||
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.
Surrounding space missing for operator +=.
Expression at 16, 11 should be on its own line.
base=f | ||
k=1 | ||
(0..r-1).step(1){|index| | ||
base=base*(r-k+1)/k |
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 -.
Surrounding space missing for operator +.
Surrounding space missing for operator /.
# My Homework | ||
|
||
def pascal(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.
Extra empty line detected at method body beginning.
k+=1} | ||
p tree} | ||
end | ||
print "Введите глубину дерева: " |
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.
term=term*(r-k+1)/k | ||
tree.push term | ||
k+=1} | ||
p tree} |
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.
Expression at 13, 11 should be on its own line.
(0..r-1).step(1){|index| | ||
term=term*(r-k+1)/k | ||
tree.push term | ||
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.
Surrounding space missing for operator +=.
Expression at 12, 11 should be on its own line.
term=1 | ||
k=1 | ||
(0..r-1).step(1){|index| | ||
term=term*(r-k+1)/k |
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 -.
Surrounding space missing for operator +.
Surrounding space missing for operator /.
n = gets.chomp.to_i | ||
|
||
pascal(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.
k+=1} | ||
p tree} | ||
end | ||
print "Введите глубину дерева: " |
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.
base=base*(r-k+1)/k | ||
tree.push base | ||
k+=1} | ||
p tree} |
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.
Expression at 17, 11 should be on its own line.
(0..r-1).step(1){|index| | ||
base=base*(r-k+1)/k | ||
tree.push base | ||
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.
Surrounding space missing for operator +=.
Expression at 16, 11 should be on its own line.
base=f | ||
k=1 | ||
(0..r-1).step(1){|index| | ||
base=base*(r-k+1)/k |
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 -.
Surrounding space missing for operator +.
Surrounding space missing for operator /.
# My Homework | ||
|
||
def pascal(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.
Extra empty line detected at method body beginning.
k+=1} | ||
p tree} | ||
end | ||
print "Введите глубину дерева: " |
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.
term=term*(r-k+1)/k | ||
tree.push term | ||
k+=1} | ||
p tree} |
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.
Expression at 13, 11 should be on its own line.
(0..r-1).step(1){|index| | ||
term=term*(r-k+1)/k | ||
tree.push term | ||
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.
Surrounding space missing for operator +=.
Expression at 12, 11 should be on its own line.
term=1 | ||
k=1 | ||
(0..r-1).step(1){|index| | ||
term=term*(r-k+1)/k |
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 -.
Surrounding space missing for operator +.
Surrounding space missing for operator /.
print 'Введите глубину дерева: ' | ||
n = gets.chomp.to_i | ||
pascal(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.
base = base * ( r - k + 1 ) / k | ||
tree.push base | ||
k += 1} | ||
p tree} |
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.
Expression at 14, 9 should be on its own line.
(0..r - 1).step(1){|index| | ||
base = base * ( r - k + 1 ) / k | ||
tree.push base | ||
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.
Inconsistent indentation detected.
Expression at 13, 13 should be on its own line.
k = 1 | ||
(0..r - 1).step(1){|index| | ||
base = base * ( r - k + 1 ) / k | ||
tree.push base |
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.
base = f | ||
k = 1 | ||
(0..r - 1).step(1){|index| | ||
base = base * ( r - k + 1 ) / k |
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 inside parentheses detected.
tree = [h] | ||
base = f | ||
k = 1 | ||
(0..r - 1).step(1){|index| |
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.
Space missing to the left of {.
Space between { and | missing.
Avoid using {...} for multi-line blocks.
Unused block argument - index. You can omit the argument if you don't care about it.
(0..n).each{|r| | ||
tree = [h] | ||
base = f | ||
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.
Inconsistent indentation detected.
print 'Введите базовый номер: ' | ||
f = gets.chomp.to_i | ||
h = f | ||
(0..n).each{|r| |
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.
Space missing to the left of {.
Space between { and | missing.
Avoid using {...} for multi-line blocks.
@@ -0,0 +1,19 @@ | |||
# My Homework | |||
def pascal(n) | |||
print 'Введите базовый номер: ' |
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.
@@ -0,0 +1,18 @@ | |||
# My Homework | |||
def pascal(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.
Indentation of first line in file detected.
@@ -0,0 +1,18 @@ | |||
# My Homework |
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.
Incorrect indentation detected (column 0 instead of 2).
base = base * ( r - k + 1 ) / k | ||
tree.push base | ||
k += 1} | ||
p tree} |
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.
Expression at 14, 11 should be on its own line.
(0..r - 1).step(1) { |index| | ||
base = base * ( r - k + 1 ) / k | ||
tree.push base | ||
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.
Inconsistent indentation detected.
Expression at 13, 15 should be on its own line.
(0..r - 1).step(1) { |index| | ||
base = base * ( r - k + 1 ) / k | ||
tree.push base | ||
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.
Inconsistent indentation detected.
Expression at 12, 15 should be on its own line.
base = f | ||
k = 1 | ||
(0..r - 1).step(1) { |index| | ||
base = base * ( r - k + 1 ) / k |
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 inside parentheses detected.
tree = [h] | ||
base = f | ||
k = 1 | ||
(0..r - 1).step(1) { |index| |
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.
Avoid using {...} for multi-line blocks.
Unused block argument - index. You can omit the argument if you don't care about it.
print 'Введите базовый номер: ' | ||
f = gets.chomp.to_i | ||
h = f | ||
(0..n).each { |r| |
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.
Avoid using {...} for multi-line blocks.
@@ -0,0 +1,17 @@ | |||
def pascal(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.
Indentation of first line in file detected.
(0..r - 1).step(1) { |index| | ||
base = base * ( r - k + 1 ) / k | ||
tree.push base | ||
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.
Inconsistent indentation detected.
Expression at 12, 13 should be on its own line.
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.
имена переменных в основном
print 'Введите базовый номер: ' | ||
f = gets.chomp.to_i | ||
h = f | ||
(0..n).each { |r| |
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.
зачем этот отступ?
print 'Введите базовый номер: ' | ||
f = gets.chomp.to_i | ||
h = f | ||
(0..n).each { |r| |
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 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.
n.times do |r|
@@ -0,0 +1,17 @@ | |||
def pascal(n) | |||
print 'Введите базовый номер: ' | |||
f = 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.
имена переменных прям очень плохие
tree = [h] | ||
base = f | ||
k = 1 | ||
(0..r - 1).step(1) { |index| |
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.
(0...r).each do
Фамилия Имя
Юрий кравченко
Email
[email protected]
Номер домашнего задания
1
Ссылка на видео с демо работы
https://youtu.be/lMHluMMwtOI
Комментарии
3 уровень сделать пока не получилось