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

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

implement hw 1 #767

wants to merge 62 commits into from

Conversation

Rakovvvv
Copy link

@Rakovvvv Rakovvvv commented Feb 19, 2018

Фамилия Имя

Раков Алексей

Email

[email protected]

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

1

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

https://www.youtube.com/watch?v=EZvfCLhp8kg&feature=youtu.be

Комментарии

Код работает но бот ругается. Бот на столько наглый, что мне обычному смертному не хочет показывать на что он ругается.

puts "depth triangle = #{n} "
print "\n\n"
require 'colorize'
triangle(n, z, c = 0)

Choose a reason for hiding this comment

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

Useless assignment to variable - c.
Final newline missing.

puts "vertex triangle = #{z} "
puts "depth triangle = #{n} "
print "\n\n"
require 'colorize'

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

n = gets.to_i
puts "vertex triangle = #{z} "
puts "depth triangle = #{n} "
print "\n\n"

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

print "enter the depth of the triangle: "
n = gets.to_i
puts "vertex triangle = #{z} "
puts "depth triangle = #{n} "

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

z = gets.to_i
print "enter the depth of the triangle: "
n = gets.to_i
puts "vertex triangle = #{z} "

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

left.push right
c += 1
k += 1
end

Choose a reason for hiding this comment

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

end at 14, 2 is not aligned with (0..r-1).step(1) do |index| at 9, 0.

k = 1
(0..r-1).step(1) do |index|
right = right*(r-k+1)/k
left.push right

Choose a reason for hiding this comment

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

Trailing whitespace detected.

c = 1
k = 1
(0..r-1).step(1) do |index|
right = right*(r-k+1)/k

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.
Surrounding space missing for operator *.
Surrounding space missing for operator -.
Surrounding space missing for operator +.
Surrounding space missing for operator /.

right = z
c = 1
k = 1
(0..r-1).step(1) do |index|

Choose a reason for hiding this comment

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

Inconsistent indentation detected.
Surrounding space missing for operator -.
Unused block argument - index. You can omit the argument if you don't care about it.

@@ -0,0 +1,28 @@
def triangle(n, z, c)
(0..n).map do |r|
n = [0]

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.

puts "#{n.center(130).green} #{m.rjust(13)}"
end
end
print 'enter the vertex of the triangle:'

Choose a reason for hiding this comment

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

Trailing whitespace detected.

end
num.to_s
left.to_s
puts "#{n.center(130).green} #{m.rjust(13)}"

Choose a reason for hiding this comment

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

Trailing whitespace detected.

(0..r - 1).step(1) do
|index|
right = right * (r - k + 1) / k
left.push right

Choose a reason for hiding this comment

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

Trailing whitespace detected.

k = 1
(0..r - 1).step(1) do
|index|
right = right * (r - k + 1) / k

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.

c = 1
k = 1
(0..r - 1).step(1) do
|index|

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.
Unused block argument - index. You can omit the argument if you don't care about it.

@@ -0,0 +1,28 @@
def triangle(n, z, c)
(0..n).map do |r|

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.

puts "vertex triangle = #{z}"
puts "depth triangle = #{n}"
require 'colorize'
triangle(n, z, c = 0)

Choose a reason for hiding this comment

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

Useless assignment to variable - c.
Final newline missing.

right = z
c = 1
k = 1
(0..r - 1).step(1)do|index|

Choose a reason for hiding this comment

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

Space before keyword do is missing.
Unused block argument - index. You can omit the argument if you don't care about it.

num.to_s
left.to_s
puts "#{n.center(130).green} #{m.rjust(13)}"
end

Choose a reason for hiding this comment

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

Tab detected.

@@ -0,0 +1,27 @@
def triangle(n, z, c)
(0..n).map do |r|
n = [0]

Choose a reason for hiding this comment

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

Use 2 (not -1) spaces for indentation.

@@ -0,0 +1,27 @@
def triangle(n, z, c)
(0..n).map do |r|

Choose a reason for hiding this comment

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

Use 2 (not 1) spaces for indentation.
Tab detected.

num.to_s
left.to_s
puts "#{n.center(130).green} #{m.rjust(13)}"
end

Choose a reason for hiding this comment

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

end at 18, 0 is not aligned with (0..n).map do |r| at 2, 2.

@@ -0,0 +1,27 @@
def triangle(n, z, c)
(0..n).map do |r|
n = [0]

Choose a reason for hiding this comment

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

Use 2 (not -2) spaces for indentation.

end
num.to_s
left.to_s
puts "#{n.center(130).green} #{m.rjust(13)}"

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

k += 1
end
num.to_s
left.to_s

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

c += 1
k += 1
end
num.to_s

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

left = [z]
right = z
c = 1
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.

num = [c]
left = [z]
right = z
c = 1

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

n = [0]
num = [c]
left = [z]
right = z

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

(0..n).map do |r|
n = [0]
num = [c]
left = [z]

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

def triangle(n, z, c)
(0..n).map do |r|
n = [0]
num = [c]

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

@@ -0,0 +1,27 @@
def triangle(n, z, c)
(0..n).map do|r|

Choose a reason for hiding this comment

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

Space after keyword do is missing.

c = 1
k = 1
(0..r - 1).step(1) do
right = right * (r - k + 1) / k

Choose a reason for hiding this comment

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

Use 2 (not -2) spaces for indentation.

left.push right
c += 1
k += 1
end

Choose a reason for hiding this comment

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

end at 14, 2 is not aligned with (0..r - 1).step(1) do at 9, 0.

c = 1
k = 1
(0..r - 1).step(1) do
right = right * (r - k + 1) / k

Choose a reason for hiding this comment

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

Use 2 (not -4) spaces for indentation.

puts "depth triangle = #{n}"
puts 'parents will be selected from the left'
require 'colorize'
triangle(n, z, c = 0, q)

Choose a reason for hiding this comment

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

Useless assignment to variable - c.

@@ -0,0 +1,37 @@
def triangle(n, z, c, q)
(0..n).map do |r|
# mas = []

Choose a reason for hiding this comment

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

Incorrect indentation detected (column 3 instead of 4).

k += 1
end
puts "#{left.center(135).green} #{num.rjust(8)}"
puts "#{mas.ljust(5).red}"

Choose a reason for hiding this comment

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

Prefer to_s over string interpolation.

@@ -0,0 +1,32 @@
def triangle(n, z, c, q)

Choose a reason for hiding this comment

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

Unused method argument - z. If it's necessary, use _ or _z as an argument name to indicate that it won't be used.
Unused method argument - c. If it's necessary, use _ or _c as an argument name to indicate that it won't be used.

k += 1
end
puts "#{left.chomt.to_s.center(135).green} #{num.chomt.to_s.rjust(8)}"
puts "#{mas.chomt.to_s.ljust(5).red}"

Choose a reason for hiding this comment

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

Inconsistent indentation detected.
Prefer to_s over string interpolation.

c += 1
k += 1
end
puts "#{left.chomt.to_s.center(135).green} #{num.chomt.to_s.rjust(8)}"

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

right = z
c = 1
k = 1
(0..r - 1).step(1) do

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

@@ -0,0 +1,37 @@
def triangle(n, z, c, q)
(0..n).map do |r|
mas = []

Choose a reason for hiding this comment

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

Use 2 (not 1) spaces for indentation.
Tab detected.

end
left.push right
c += 1
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.

mas.push right
end
left.push right
c += 1

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

mas.push o
mas.push right
end
left.push right

Choose a reason for hiding this comment

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

Inconsistent indentation detected.

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.

Залей рабочий код, а с ботом уже как-то договоримся

root and others added 3 commits March 12, 2018 01:19
print 'enter a child:'
q = gets.to_i
puts "vertex triangle = #{z}"
puts "depth triangle = #{n}"

Choose a reason for hiding this comment

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

Trailing whitespace detected.

print 'enter the depth of the triangle:'
n = gets.to_i
print 'enter a child:'
q = gets.to_i

Choose a reason for hiding this comment

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

Trailing whitespace detected.

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