Skip to content

Instantly share code, notes, and snippets.

@modalsoul
Created October 11, 2011 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save modalsoul/1277895 to your computer and use it in GitHub Desktop.
Save modalsoul/1277895 to your computer and use it in GitHub Desktop.
def fizzbuzz(args:Int){
(1 to args).foreach({ i =>
if((i%3)==0 && (i%5)==0)
println("FizzBuzz")
else if(i % 3 == 0)
println("Fizz")
else if(i % 5 == 0)
println("Buzz")
else
println(i)
})
}
fizzbuzz(15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment