Created
November 27, 2013 16:21
-
-
Save jonelf/7678519 to your computer and use it in GitHub Desktop.
FizzBuzz
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
[<EntryPoint>] | |
let main _= | |
for n in 1..100 do | |
let s = seq { | |
if n % 3 = 0 then yield "Fizz" | |
if n % 5 = 0 then yield "Buzz" } | |
if Seq.isEmpty s then printf "%d"n | |
printfn "%s"(s |> String.concat "") | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's exactly what made me do it! Couldn't find an example without the n % 15 and I've always seen that as part of this "stupid" assignment.