[Vit-discuss] Top Ruby Projects algorithm?

zdennis zdennis at mktec.com
Fri Aug 25 16:06:58 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The sum example with inject IMO is great...

  numbers = 1, 3, 5, 7, 9, 11, 13, 15, 17
  sum = numbers.inject( 0 ){ |sum,n| sum+=n }
  puts "The sum is #{sum}!"

Zach
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE71hiMyx0fW1d8G0RAsg4AJ9jWvjTMOV7FUrPrJ0/VTbRA1JgrQCfXIJp
1S0kyiHFOSl3ENGAsna8FjE=
=iKCM
-----END PGP SIGNATURE-----


More information about the vit-discuss mailing list