Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Feb 26th, 2012  |  syntax: None  |  size: 0.17 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. require './integer'
  2. require 'prime'
  3.  
  4. limit  = ARGV.first.to_i
  5. method = ARGV.last.to_sym
  6.  
  7. sum = (2...limit).select(&method).inject :+
  8.  
  9. puts "sum(primes < #{limit}) = #{sum}"