Created
November 15, 2016 22:06
-
-
Save Ellyll/eaa5428af9c85a426928f2c7706dea36 to your computer and use it in GitHub Desktop.
F# FizzBuzz attempt
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
let fizzBuzz n = | |
if n % 3 = 0 && n % 5 = 0 then "FizzBuzz" | |
elif n % 3 = 0 then "Fizz" | |
elif n % 5 = 0 then "Buzz" | |
else (sprintf "%d" n) | |
let a = seq { 1 .. 20 } | |
a | |
|> Seq.iter (fun n -> printfn "%d: %s" n (fizzBuzz n)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment