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
Changes from 7 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
6f049c7
implement hw 1
Rakovvvv Feb 19, 2018
2e7001d
fix styling issues
Rakovvvv Feb 19, 2018
b18b1aa
fix3
Rakovvvv Feb 20, 2018
9ba3bd9
fix4
Rakovvvv Feb 20, 2018
82c0465
fix5
Rakovvvv Feb 20, 2018
2ed5adc
fix6
Rakovvvv Feb 20, 2018
cc84521
fix7
Rakovvvv Feb 20, 2018
1409731
fix8
Rakovvvv Feb 20, 2018
10e6100
fix9
Rakovvvv Feb 20, 2018
e8f2340
fix10
Rakovvvv Feb 20, 2018
d275ee0
fix11
Rakovvvv Feb 20, 2018
3d1ecd1
fix12
Rakovvvv Feb 20, 2018
30d5bcf
fix13
Rakovvvv Feb 20, 2018
9f4f1d7
fix14
Rakovvvv Feb 20, 2018
d5a9453
fix15
Rakovvvv Feb 20, 2018
36b4e00
fix16
Rakovvvv Feb 20, 2018
164758f
fix17
Rakovvvv Feb 20, 2018
d571c18
fix18
Rakovvvv Feb 20, 2018
ee97bb1
fix19
Rakovvvv Feb 20, 2018
fa274fa
fix20
Rakovvvv Feb 20, 2018
63b1e72
fix21
Rakovvvv Feb 20, 2018
34166a4
fix22
Rakovvvv Feb 20, 2018
3e3f87a
fix23
Rakovvvv Feb 20, 2018
d7939e3
fix24
Rakovvvv Feb 20, 2018
825907a
fix26
Rakovvvv Feb 20, 2018
873d583
fix27
Rakovvvv Feb 20, 2018
fd118f5
fix28
Rakovvvv Feb 20, 2018
186e159
fix30
Rakovvvv Feb 20, 2018
3c2e868
fix31
Rakovvvv Feb 20, 2018
2f70e50
fix32
Rakovvvv Feb 20, 2018
d9dea00
fix33
Rakovvvv Feb 20, 2018
e03731e
fix35
Rakovvvv Feb 20, 2018
ff12845
fix36
Rakovvvv Feb 20, 2018
2928792
fix37
Rakovvvv Feb 20, 2018
18a8b3e
fix38
Rakovvvv Feb 20, 2018
7627b23
fix39
Rakovvvv Feb 20, 2018
2a33924
fix40
Rakovvvv Feb 20, 2018
3045604
fix41
Rakovvvv Feb 20, 2018
34f2356
fix42
Rakovvvv Feb 20, 2018
d23871f
fix43
Rakovvvv Feb 20, 2018
281bcd3
fix44
Rakovvvv Feb 21, 2018
2541d2f
fix45
Rakovvvv Feb 21, 2018
2ef4e51
fix46
Rakovvvv Feb 21, 2018
4359fb7
fix47
Rakovvvv Feb 21, 2018
2cba762
fix48
Rakovvvv Feb 21, 2018
f59d090
fix48
Rakovvvv Feb 21, 2018
97b9ff1
fix50
Rakovvvv Feb 21, 2018
baef018
fix51
Rakovvvv Feb 21, 2018
b6c5ceb
fix52
Rakovvvv Feb 21, 2018
7507247
fix53
Rakovvvv Feb 21, 2018
24896d7
fix54
Rakovvvv Feb 21, 2018
ff7486a
fix55
Rakovvvv Feb 21, 2018
bd602a4
fix57
Rakovvvv Feb 21, 2018
6f14fdd
fix58
Rakovvvv Feb 21, 2018
63080f1
fix59
Rakovvvv Feb 21, 2018
3cfc6c3
fix60
Rakovvvv Feb 21, 2018
98feca9
fix60
Rakovvvv Feb 21, 2018
a65f132
fix69
Mar 11, 2018
0a81162
fix70
Mar 11, 2018
fe78f96
fix61
Rakovvvv Mar 23, 2018
1dae54e
fix62
Rakovvvv Mar 23, 2018
c40c44b
fix63
Rakovvvv Mar 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions 2018/AlexeiRakov/1/piramid.rb
Original file line number Diff line number Diff line change
@@ -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.

Block has too many lines. [28/25]

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.

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.

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.

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.

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.

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.

(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 0) spaces for indentation.

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.

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.

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, 0 is not aligned with (0..r - 1).step(1) do at 9, 2.

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

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.

end

Choose a reason for hiding this comment

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

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

end
print 'enter the vertex of the triangle:'
z = gets.to_i
print 'enter the depth of the triangle:'
n = gets.to_i
puts "vertex triangle = #{z}"
puts "depth triangle = #{n}"
require 'colorize'
triangle(n, z, c)