Created
January 2, 2016 17:21
-
-
Save juanchosaravia/a063c99fb06dda9b2ef9 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
for n in 0...100 { | |
var msg = "" | |
switch(n) { | |
case 30...40: | |
msg = "Viva Swift!!!" | |
case let (x) where (x%5 == 0): | |
msg = "Bingo!!!" | |
case let (x) where (x%2 == 0): | |
msg = "par!!!" | |
case let (x) where (x%2 == 1): | |
msg = "impar!!!" | |
default: | |
msg = "empty" | |
} | |
print("#\(n) \(msg)") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment