Skip to content

Instantly share code, notes, and snippets.

@Ellyll
Created November 15, 2016 22:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ellyll/eaa5428af9c85a426928f2c7706dea36 to your computer and use it in GitHub Desktop.
Save Ellyll/eaa5428af9c85a426928f2c7706dea36 to your computer and use it in GitHub Desktop.
F# FizzBuzz attempt
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