Created
November 27, 2015 06:37
-
-
Save sooop/dd905de7b6ab7765a379 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /* FizzBuzz in swift */ | |
| for x in 1...100 { | |
| switch (x % 3, x % 5) { | |
| case (0, 0): | |
| print("FizzBuzz") | |
| case (0, _): | |
| print("Fizz") | |
| case (_, 0): | |
| print("Buzz") | |
| default: | |
| print(x) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment