Created
February 6, 2016 19:53
-
-
Save yarneo/142198207d1a407aac3d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func bouncerResponse(job: String, age: Int, bribe: Int) -> String? { | |
switch (job, age, bribe) { | |
case (let j, _, _) where (j.rangeOfString(“model”) != nil) : | |
return “come in, welcome, the VIP is that way :)” | |
case (_, 0..<21, _): return “too young bro” | |
case (“Owner of OMNIA”, 32, _): | |
return “sorry, we don’t let our competitors in” | |
case (_, _, let b) where b >= 100: | |
return “Welcome to our nightclub!” | |
default: return “sorry, we are at full capacity” | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment