odd_rule = proc { |n| n % 2 == 1 }even_rule = proc { |n| n % 2 == 0 } case 10when odd_rule print "Odd!"when even_rule print "Even!"end
Standard input is empty
Even!
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!