-
Notifications
You must be signed in to change notification settings - Fork 167
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
Rakovvvv
wants to merge
62
commits into
rubyroidlabs:master
Choose a base branch
from
Rakovvvv:homework-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
implement hw 1 #767
Changes from 57 commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
6f049c7
implement hw 1
Rakovvvv 2e7001d
fix styling issues
Rakovvvv b18b1aa
fix3
Rakovvvv 9ba3bd9
fix4
Rakovvvv 82c0465
fix5
Rakovvvv 2ed5adc
fix6
Rakovvvv cc84521
fix7
Rakovvvv 1409731
fix8
Rakovvvv 10e6100
fix9
Rakovvvv e8f2340
fix10
Rakovvvv d275ee0
fix11
Rakovvvv 3d1ecd1
fix12
Rakovvvv 30d5bcf
fix13
Rakovvvv 9f4f1d7
fix14
Rakovvvv d5a9453
fix15
Rakovvvv 36b4e00
fix16
Rakovvvv 164758f
fix17
Rakovvvv d571c18
fix18
Rakovvvv ee97bb1
fix19
Rakovvvv fa274fa
fix20
Rakovvvv 63b1e72
fix21
Rakovvvv 34166a4
fix22
Rakovvvv 3e3f87a
fix23
Rakovvvv d7939e3
fix24
Rakovvvv 825907a
fix26
Rakovvvv 873d583
fix27
Rakovvvv fd118f5
fix28
Rakovvvv 186e159
fix30
Rakovvvv 3c2e868
fix31
Rakovvvv 2f70e50
fix32
Rakovvvv d9dea00
fix33
Rakovvvv e03731e
fix35
Rakovvvv ff12845
fix36
Rakovvvv 2928792
fix37
Rakovvvv 18a8b3e
fix38
Rakovvvv 7627b23
fix39
Rakovvvv 2a33924
fix40
Rakovvvv 3045604
fix41
Rakovvvv 34f2356
fix42
Rakovvvv d23871f
fix43
Rakovvvv 281bcd3
fix44
Rakovvvv 2541d2f
fix45
Rakovvvv 2ef4e51
fix46
Rakovvvv 4359fb7
fix47
Rakovvvv 2cba762
fix48
Rakovvvv f59d090
fix48
Rakovvvv 97b9ff1
fix50
Rakovvvv baef018
fix51
Rakovvvv b6c5ceb
fix52
Rakovvvv 7507247
fix53
Rakovvvv 24896d7
fix54
Rakovvvv ff7486a
fix55
Rakovvvv bd602a4
fix57
Rakovvvv 6f14fdd
fix58
Rakovvvv 63080f1
fix59
Rakovvvv 3cfc6c3
fix60
Rakovvvv 98feca9
fix60
Rakovvvv a65f132
fix69
0a81162
fix70
fe78f96
fix61
Rakovvvv 1dae54e
fix62
Rakovvvv c40c44b
fix63
Rakovvvv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
def triangle(n, z, c) | ||
(0..n).map do |r| | ||
n = [0] | ||
num = [c] | ||
left = [z] | ||
right = z | ||
c = 1 | ||
k = 1 | ||
(0..r - 1).step(1) do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent indentation detected. |
||
right = right * (r - k + 1) / k | ||
left.push right | ||
c += 1 | ||
k += 1 | ||
end | ||
num.to_s | ||
left.to_s | ||
puts "#{n.center(130).green} #{m.rjust(13)}" | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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]