Conversation
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 |
There was a problem hiding this comment.
Useless assignment to variable - c.
Final newline missing.
2018/AlexeiRakov/1/piramid.rb
Outdated
| puts "vertex triangle = #{z} " | ||
| puts "depth triangle = #{n} " | ||
| print "\n\n" | ||
| require 'colorize' |
There was a problem hiding this comment.
Inconsistent indentation detected.
2018/AlexeiRakov/1/piramid.rb
Outdated
| n = gets.to_i | ||
| puts "vertex triangle = #{z} " | ||
| puts "depth triangle = #{n} " | ||
| print "\n\n" |
There was a problem hiding this comment.
Inconsistent indentation detected.
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} " |
There was a problem hiding this comment.
Inconsistent indentation detected.
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} " |
There was a problem hiding this comment.
Inconsistent indentation detected.
2018/AlexeiRakov/1/piramid.rb
Outdated
| left.push right | ||
| c += 1 | ||
| k += 1 | ||
| end |
There was a problem hiding this comment.
end at 14, 2 is not aligned with (0..r-1).step(1) do |index| at 9, 0.
2018/AlexeiRakov/1/piramid.rb
Outdated
| k = 1 | ||
| (0..r-1).step(1) do |index| | ||
| right = right*(r-k+1)/k | ||
| left.push right |
2018/AlexeiRakov/1/piramid.rb
Outdated
| c = 1 | ||
| k = 1 | ||
| (0..r-1).step(1) do |index| | ||
| right = right*(r-k+1)/k |
There was a problem hiding this comment.
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 /.
2018/AlexeiRakov/1/piramid.rb
Outdated
| right = z | ||
| c = 1 | ||
| k = 1 | ||
| (0..r-1).step(1) do |index| |
There was a problem hiding this comment.
Inconsistent indentation detected.
Surrounding space missing for operator -.
Unused block argument - index. You can omit the argument if you don't care about it.
2018/AlexeiRakov/1/piramid.rb
Outdated
| @@ -0,0 +1,28 @@ | |||
| def triangle(n, z, c) | |||
| (0..n).map do |r| | |||
| n = [0] | |||
There was a problem hiding this comment.
Use 2 (not 0) spaces for indentation.
2018/AlexeiRakov/1/piramid.rb
Outdated
| puts "#{n.center(130).green} #{m.rjust(13)}" | ||
| end | ||
| end | ||
| print 'enter the vertex of the triangle:' |
2018/AlexeiRakov/1/piramid.rb
Outdated
| end | ||
| num.to_s | ||
| left.to_s | ||
| puts "#{n.center(130).green} #{m.rjust(13)}" |
2018/AlexeiRakov/1/piramid.rb
Outdated
| (0..r - 1).step(1) do | ||
| |index| | ||
| right = right * (r - k + 1) / k | ||
| left.push right |
2018/AlexeiRakov/1/piramid.rb
Outdated
| k = 1 | ||
| (0..r - 1).step(1) do | ||
| |index| | ||
| right = right * (r - k + 1) / k |
There was a problem hiding this comment.
Use 2 (not 0) spaces for indentation.
2018/AlexeiRakov/1/piramid.rb
Outdated
| c = 1 | ||
| k = 1 | ||
| (0..r - 1).step(1) do | ||
| |index| |
There was a problem hiding this comment.
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.
2018/AlexeiRakov/1/piramid.rb
Outdated
| @@ -0,0 +1,28 @@ | |||
| def triangle(n, z, c) | |||
| (0..n).map do |r| | |||
There was a problem hiding this comment.
Use 2 (not 0) spaces for indentation.
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 |
There was a problem hiding this comment.
Useless assignment to variable - c.
Final newline missing.
2018/AlexeiRakov/1/piramid.rb
Outdated
| right = z | ||
| c = 1 | ||
| k = 1 | ||
| (0..r - 1).step(1)do|index| |
There was a problem hiding this comment.
Space before keyword do is missing.
Unused block argument - index. You can omit the argument if you don't care about it.
2018/AlexeiRakov/1/piramid.rb
Outdated
| num.to_s | ||
| left.to_s | ||
| puts "#{n.center(130).green} #{m.rjust(13)}" | ||
| end |
2018/AlexeiRakov/1/piramid.rb
Outdated
| @@ -0,0 +1,27 @@ | |||
| def triangle(n, z, c) | |||
| (0..n).map do |r| | |||
| n = [0] | |||
There was a problem hiding this comment.
Use 2 (not -1) spaces for indentation.
2018/AlexeiRakov/1/piramid.rb
Outdated
| @@ -0,0 +1,27 @@ | |||
| def triangle(n, z, c) | |||
| (0..n).map do |r| | |||
There was a problem hiding this comment.
Use 2 (not 1) spaces for indentation.
Tab detected.
2018/AlexeiRakov/1/piramid.rb
Outdated
| num.to_s | ||
| left.to_s | ||
| puts "#{n.center(130).green} #{m.rjust(13)}" | ||
| end |
There was a problem hiding this comment.
end at 18, 0 is not aligned with (0..n).map do |r| at 2, 2.
2018/AlexeiRakov/1/piramid.rb
Outdated
| @@ -0,0 +1,27 @@ | |||
| def triangle(n, z, c) | |||
| (0..n).map do |r| | |||
| n = [0] | |||
There was a problem hiding this comment.
Use 2 (not -2) spaces for indentation.
2018/AlexeiRakov/1/piramid.rb
Outdated
| end | ||
| num.to_s | ||
| left.to_s | ||
| puts "#{n.center(130).green} #{m.rjust(13)}" |
There was a problem hiding this comment.
Inconsistent indentation detected.
2018/AlexeiRakov/1/piramid.rb
Outdated
| k += 1 | ||
| end | ||
| num.to_s | ||
| left.to_s |
There was a problem hiding this comment.
Inconsistent indentation detected.
2018/AlexeiRakov/1/piramid.rb
Outdated
| c += 1 | ||
| k += 1 | ||
| end | ||
| num.to_s |
There was a problem hiding this comment.
Inconsistent indentation detected.
2018/AlexeiRakov/1/piramid.rb
Outdated
| left = [z] | ||
| right = z | ||
| c = 1 | ||
| k = 1 |
There was a problem hiding this comment.
Inconsistent indentation detected.
2018/AlexeiRakov/1/piramid.rb
Outdated
| num = [c] | ||
| left = [z] | ||
| right = z | ||
| c = 1 |
There was a problem hiding this comment.
Inconsistent indentation detected.
2018/AlexeiRakov/1/piramid.rb
Outdated
| n = [0] | ||
| num = [c] | ||
| left = [z] | ||
| right = z |
There was a problem hiding this comment.
Inconsistent indentation detected.
2018/AlexeiRakov/1/piramid.rb
Outdated
| (0..n).map do |r| | ||
| n = [0] | ||
| num = [c] | ||
| left = [z] |
There was a problem hiding this comment.
Inconsistent indentation detected.
2018/AlexeiRakov/1/piramid.rb
Outdated
| def triangle(n, z, c) | ||
| (0..n).map do |r| | ||
| n = [0] | ||
| num = [c] |
There was a problem hiding this comment.
Inconsistent indentation detected.
2018/AlexeiRakov/1/piramid.rb
Outdated
| @@ -0,0 +1,27 @@ | |||
| def triangle(n, z, c) | |||
| (0..n).map do|r| | |||
There was a problem hiding this comment.
Space after keyword do is missing.
2018/AlexeiRakov/1/piramid.rb
Outdated
| c = 1 | ||
| k = 1 | ||
| (0..r - 1).step(1) do | ||
| right = right * (r - k + 1) / k |
There was a problem hiding this comment.
Use 2 (not -2) spaces for indentation.
2018/AlexeiRakov/1/piramid.rb
Outdated
| left.push right | ||
| c += 1 | ||
| k += 1 | ||
| end |
There was a problem hiding this comment.
end at 14, 2 is not aligned with (0..r - 1).step(1) do at 9, 0.
2018/AlexeiRakov/1/piramid.rb
Outdated
| c = 1 | ||
| k = 1 | ||
| (0..r - 1).step(1) do | ||
| right = right * (r - k + 1) / k |
There was a problem hiding this comment.
Use 2 (not -4) spaces for indentation.
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) |
There was a problem hiding this comment.
Useless assignment to variable - c.
2018/AlexeiRakov/1/piramid.rb
Outdated
| @@ -0,0 +1,37 @@ | |||
| def triangle(n, z, c, q) | |||
| (0..n).map do |r| | |||
| # mas = [] | |||
There was a problem hiding this comment.
Incorrect indentation detected (column 3 instead of 4).
2018/AlexeiRakov/1/piramid.rb
Outdated
| k += 1 | ||
| end | ||
| puts "#{left.center(135).green} #{num.rjust(8)}" | ||
| puts "#{mas.ljust(5).red}" |
There was a problem hiding this comment.
Prefer to_s over string interpolation.
| @@ -0,0 +1,32 @@ | |||
| def triangle(n, z, c, q) | |||
There was a problem hiding this comment.
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.
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}" |
There was a problem hiding this comment.
Inconsistent indentation detected.
Prefer to_s over string interpolation.
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)}" |
There was a problem hiding this comment.
Inconsistent indentation detected.
| right = z | ||
| c = 1 | ||
| k = 1 | ||
| (0..r - 1).step(1) do |
There was a problem hiding this comment.
Inconsistent indentation detected.
| @@ -0,0 +1,37 @@ | |||
| def triangle(n, z, c, q) | |||
| (0..n).map do |r| | |||
| mas = [] | |||
There was a problem hiding this comment.
Use 2 (not 1) spaces for indentation.
Tab detected.
2018/AlexeiRakov/1/piramid.rb
Outdated
| end | ||
| left.push right | ||
| c += 1 | ||
| k += 1 |
There was a problem hiding this comment.
Inconsistent indentation detected.
2018/AlexeiRakov/1/piramid.rb
Outdated
| mas.push right | ||
| end | ||
| left.push right | ||
| c += 1 |
There was a problem hiding this comment.
Inconsistent indentation detected.
2018/AlexeiRakov/1/piramid.rb
Outdated
| mas.push o | ||
| mas.push right | ||
| end | ||
| left.push right |
There was a problem hiding this comment.
Inconsistent indentation detected.
Xanderwot
left a comment
There was a problem hiding this comment.
Залей рабочий код, а с ботом уже как-то договоримся
2018/AlexeiRakov/1/piramid.rb
Outdated
| print 'enter a child:' | ||
| q = gets.to_i | ||
| puts "vertex triangle = #{z}" | ||
| puts "depth triangle = #{n}" |
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 |
Фамилия Имя
Раков Алексей
Email
fargon946@gmail.com
Номер домашнего задания
1
Ссылка на видео с демо работы
https://www.youtube.com/watch?v=EZvfCLhp8kg&feature=youtu.be
Комментарии
Код работает но бот ругается. Бот на столько наглый, что мне обычному смертному не хочет показывать на что он ругается.