Skip to content

Instantly share code, notes, and snippets.

@yuya-takeyama
Created August 21, 2010 15:55
Show Gist options
  • Save yuya-takeyama/542482 to your computer and use it in GitHub Desktop.
Save yuya-takeyama/542482 to your computer and use it in GitHub Desktop.
n = 100
r = [1, 2, 3, 4, 5].inject(0) {|n, i| n + i }
puts "r = " + r.to_s
puts "n = " + n.to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment