Skip to content
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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

atom-unique
Copy link

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

Фамилия Имя

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

Email

[email protected]

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

1

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

https://youtu.be/lMHluMMwtOI

Комментарии

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

n = gets.chomp.to_i

pascal(n)

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

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}

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}

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

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)

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

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}

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}

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

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)

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

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}

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}

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

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)

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

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}

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}

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

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)

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}

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}

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

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

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|

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

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|

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

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)

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

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}

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}

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}

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

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|

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|

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)

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}

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
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
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
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
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
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
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