Skip to content

implement hw 1#767

Open
Rakovvvv wants to merge 62 commits intorubyroidlabs:masterfrom
Rakovvvv:homework-1
Open

implement hw 1#767
Rakovvvv wants to merge 62 commits intorubyroidlabs:masterfrom
Rakovvvv:homework-1

Conversation

@Rakovvvv
Copy link
Copy Markdown

@Rakovvvv Rakovvvv commented Feb 19, 2018

Фамилия Имя

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

Email

fargon946@gmail.com

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

1

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

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

Комментарии

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

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
puts "depth triangle = #{n} "
print "\n\n"
require 'colorize'
triangle(n, z, c = 0) No newline at end of file
Copy link
Copy Markdown

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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
puts "vertex triangle = #{z} "
puts "depth triangle = #{n} "
print "\n\n"
require 'colorize'
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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
n = gets.to_i
puts "vertex triangle = #{z} "
puts "depth triangle = #{n} "
print "\n\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.

Inconsistent indentation detected.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
print "enter the depth of the triangle: "
n = gets.to_i
puts "vertex triangle = #{z} "
puts "depth triangle = #{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.

Inconsistent indentation detected.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
z = gets.to_i
print "enter the depth of the triangle: "
n = gets.to_i
puts "vertex triangle = #{z} "
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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
left.push right
c += 1
k += 1
end
Copy link
Copy Markdown

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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
k = 1
(0..r-1).step(1) do |index|
right = right*(r-k+1)/k
left.push right
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Trailing whitespace detected.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
c = 1
k = 1
(0..r-1).step(1) do |index|
right = right*(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.

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

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
right = z
c = 1
k = 1
(0..r-1).step(1) do |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.
Surrounding space missing for operator -.
Unused block argument - index. You can omit the argument if you don't care about it.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
@@ -0,0 +1,28 @@
def triangle(n, z, c)
(0..n).map do |r|
n = [0]
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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
puts "#{n.center(130).green} #{m.rjust(13)}"
end
end
print 'enter the vertex of the triangle:'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Trailing whitespace detected.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
end
num.to_s
left.to_s
puts "#{n.center(130).green} #{m.rjust(13)}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Trailing whitespace detected.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
(0..r - 1).step(1) do
|index|
right = right * (r - k + 1) / k
left.push right
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Trailing whitespace detected.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
k = 1
(0..r - 1).step(1) do
|index|
right = right * (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.

Use 2 (not 0) spaces for indentation.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
c = 1
k = 1
(0..r - 1).step(1) do
|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.

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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
@@ -0,0 +1,28 @@
def triangle(n, z, c)
(0..n).map do |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.

Use 2 (not 0) spaces for indentation.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
puts "vertex triangle = #{z}"
puts "depth triangle = #{n}"
require 'colorize'
triangle(n, z, c = 0) No newline at end of file
Copy link
Copy Markdown

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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
right = z
c = 1
k = 1
(0..r - 1).step(1)do|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.

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

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
num.to_s
left.to_s
puts "#{n.center(130).green} #{m.rjust(13)}"
end
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tab detected.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
@@ -0,0 +1,27 @@
def triangle(n, z, c)
(0..n).map do |r|
n = [0]
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 -1) spaces for indentation.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
@@ -0,0 +1,27 @@
def triangle(n, z, c)
(0..n).map do |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.

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

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
num.to_s
left.to_s
puts "#{n.center(130).green} #{m.rjust(13)}"
end
Copy link
Copy Markdown

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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
@@ -0,0 +1,27 @@
def triangle(n, z, c)
(0..n).map do |r|
n = [0]
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 -2) spaces for indentation.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
end
num.to_s
left.to_s
puts "#{n.center(130).green} #{m.rjust(13)}"
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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
k += 1
end
num.to_s
left.to_s
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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
c += 1
k += 1
end
num.to_s
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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
left = [z]
right = z
c = 1
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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
num = [c]
left = [z]
right = z
c = 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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
n = [0]
num = [c]
left = [z]
right = z
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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
(0..n).map do |r|
n = [0]
num = [c]
left = [z]
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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
def triangle(n, z, c)
(0..n).map do |r|
n = [0]
num = [c]
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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
@@ -0,0 +1,27 @@
def triangle(n, z, c)
(0..n).map do|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.

Space after keyword do is missing.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
c = 1
k = 1
(0..r - 1).step(1) do
right = right * (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.

Use 2 (not -2) spaces for indentation.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
left.push right
c += 1
k += 1
end
Copy link
Copy Markdown

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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
c = 1
k = 1
(0..r - 1).step(1) do
right = right * (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.

Use 2 (not -4) spaces for indentation.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
puts "depth triangle = #{n}"
puts 'parents will be selected from the left'
require 'colorize'
triangle(n, z, c = 0, q)
Copy link
Copy Markdown

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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
@@ -0,0 +1,37 @@
def triangle(n, z, c, q)
(0..n).map do |r|
# mas = []
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 3 instead of 4).

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
k += 1
end
puts "#{left.center(135).green} #{num.rjust(8)}"
puts "#{mas.ljust(5).red}"
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 to_s over string interpolation.

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

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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
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}"
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.
Prefer to_s over string interpolation.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
c += 1
k += 1
end
puts "#{left.chomt.to_s.center(135).green} #{num.chomt.to_s.rjust(8)}"
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.

right = z
c = 1
k = 1
(0..r - 1).step(1) do
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.

@@ -0,0 +1,37 @@
def triangle(n, z, c, q)
(0..n).map do |r|
mas = []
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 1) spaces for indentation.
Tab detected.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
end
left.push right
c += 1
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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
mas.push right
end
left.push right
c += 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.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
mas.push o
mas.push right
end
left.push right
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.

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.

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

root and others added 3 commits March 12, 2018 01:19
Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
print 'enter a child:'
q = gets.to_i
puts "vertex triangle = #{z}"
puts "depth triangle = #{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.

Trailing whitespace detected.

Comment thread 2018/AlexeiRakov/1/piramid.rb Outdated
print 'enter the depth of the triangle:'
n = gets.to_i
print 'enter a child:'
q = gets.to_i
Copy link
Copy Markdown

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