Skip to content

Instantly share code, notes, and snippets.

@lukaszkorecki
Forked from tomekwojcik/case.rb
Created March 26, 2010 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukaszkorecki/344824 to your computer and use it in GitHub Desktop.
Save lukaszkorecki/344824 to your computer and use it in GitHub Desktop.
// w js nie ma switcha z regexem :-(
elo = ''
if re.match(r'/zorb/', input):
elo = "shoop de doop"
elif re.match(r'/blomp/', input):
elo "imma chagin mah lazah"
else:
elo = "FIAL"
elo = case input
when /zorb/ then "shoop de doop"
when /blomp/ then "imma chagin mah lazah"
else "FIAL"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment