Sha256: 6e8c7ca849b87d8044a57fc0ab1fb7e9c5422e2174792d8457d8de8309549095

Contents?: true

Size: 83 Bytes

Versions: 29

Compression:

Stored size: 83 Bytes

Contents

def triangle(n)
  (0..n).inject do |sum, i|
    sum +=i
  end
end
puts triangle(3)

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/byebug-2.7.0/test/examples/tri3.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/byebug-2.7.0/test/examples/tri3.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/byebug-2.7.0/test/examples/tri3.rb
byebug-3.0.0 test/examples/tri3.rb
byebug-2.7.0 test/examples/tri3.rb
byebug-2.6.0 test/examples/tri3.rb
byebug-2.5.0 test/examples/tri3.rb
byebug-2.4.1 test/examples/tri3.rb
byebug-2.4.0 test/examples/tri3.rb
byebug-2.3.1 test/examples/tri3.rb
byebug-2.3.0 test/examples/tri3.rb
byebug-2.2.2 old_doc/tri3.rb
byebug-2.2.1 old_doc/tri3.rb
byebug-2.2.0 old_doc/tri3.rb
byebug-2.1.1 old_doc/tri3.rb
byebug-2.1.0 old_doc/tri3.rb
byebug-2.0.0 old_doc/tri3.rb
byebug-1.8.2 old_doc/tri3.rb
byebug-1.8.1 old_doc/tri3.rb
byebug-1.8.0 old_doc/tri3.rb