fork download
  1. odd_rule = proc { |n| n % 2 == 1 }
  2. even_rule = proc { |n| n % 2 == 0 }
  3.  
  4. case 10
  5. when odd_rule
  6. print "Odd!"
  7. when even_rule
  8. print "Even!"
  9. end
  10.  
Success #stdin #stdout 0.01s 7452KB
stdin
Standard input is empty
stdout
Even!