Skip to content

Instantly share code, notes, and snippets.

@Biacco42
Created April 3, 2017 08:03
Show Gist options
  • Save Biacco42/8b585d6fa56a67f4b138369cbc9a2303 to your computer and use it in GitHub Desktop.
Save Biacco42/8b585d6fa56a67f4b138369cbc9a2303 to your computer and use it in GitHub Desktop.
(1 ..< 100).forEach {
switch ($0 % 3, $0 % 5) {
case (0, 0):
print("FizzBuzz")
case (0, _):
print("Fizz")
case (_, 0):
print("Buzz")
default:
print($0)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment