Skip to content

Instantly share code, notes, and snippets.

@Leammas
Created January 20, 2017 09:32
Show Gist options
  • Save Leammas/434a6b3098058a57c04693295a388d06 to your computer and use it in GitHub Desktop.
Save Leammas/434a6b3098058a57c04693295a388d06 to your computer and use it in GitHub Desktop.
for {
num <- 1 to 100
} yield {
if (num % 3 == 0) print("Fizz")
if (num % 5 == 0) print("Buzz")
if (num % 3 != 0 && num % 5 != 0) print(num)
print("\n")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment