Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

9 lines (7 sloc) 0.107 kB
#!/usr/bin/env ruby
def triangle(n)
(0..n).inject do |sum, i|
sum +=i
end
end
puts triangle(3)
Jump to Line
Something went wrong with that request. Please try again.