Skip to content

implement hw 1#768

Open
atom-unique wants to merge 8 commits intorubyroidlabs:masterfrom
atom-unique:Homework-1
Open

implement hw 1#768
atom-unique wants to merge 8 commits intorubyroidlabs:masterfrom
atom-unique:Homework-1

Conversation

@atom-unique
Copy link
Copy Markdown

@atom-unique atom-unique commented Feb 20, 2018

Фамилия Имя

Юрий кравченко

Email

yurezz08@mail.ru

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

1

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

https://youtu.be/lMHluMMwtOI

Комментарии

3 уровень сделать пока не получилось

n = gets.chomp.to_i

pascal(n)

Copy link
Copy Markdown

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 "Введите глубину дерева: "
Copy link
Copy Markdown

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}
Copy link
Copy Markdown

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}
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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)

Copy link
Copy Markdown

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 "Введите глубину дерева: "
Copy link
Copy Markdown

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}
Copy link
Copy Markdown

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}
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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)

Copy link
Copy Markdown

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 "Введите глубину дерева: "
Copy link
Copy Markdown

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}
Copy link
Copy Markdown

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}
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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)

Copy link
Copy Markdown

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 "Введите глубину дерева: "
Copy link
Copy Markdown

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}
Copy link
Copy Markdown

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}
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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)

Copy link
Copy Markdown

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}
Copy link
Copy Markdown

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}
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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|
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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|
Copy link
Copy Markdown

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 'Введите базовый номер: '
Copy link
Copy Markdown

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)
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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}
Copy link
Copy Markdown

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}
Copy link
Copy Markdown

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}
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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|
Copy link
Copy Markdown

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|
Copy link
Copy Markdown

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)
Copy link
Copy Markdown

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}
Copy link
Copy Markdown

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.

Copy link
Copy Markdown
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.

имена переменных в основном

print 'Введите базовый номер: '
f = gets.chomp.to_i
h = f
(0..n).each { |r|
Copy link
Copy Markdown
Contributor

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|
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

используй do end вместо { } для многострочных блоков.

Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

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|
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(0...r).each do

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