From kodeboard, 4 Years ago, written in Ruby.
Embed
  1. case a
  2. when 1..3
  3.   puts "Found number between 1 and 3"
  4. when 4
  5.   puts "Case 4"
  6. when String
  7.   puts "String case"
  8. else
  9.   puts "Passed #{a} -- try again."
  10. end

You must login to reply or comment on this code.