Skip to content

Instantly share code, notes, and snippets.

@rarous
Last active January 1, 2016 04:39
Show Gist options
  • Save rarous/8092855 to your computer and use it in GitHub Desktop.
Save rarous/8092855 to your computer and use it in GitHub Desktop.
let FizzBuzz n convert =
[1..n] |> List.map convert |> String.concat ","
let (|DivizableBy|_|) divizor i =
if i % divizor = 0 then Some() else None
let NumberToString = function
| DivizableBy 3 & DivizableBy 5 -> "FizzBuzz"
| DivizableBy 3 -> "Fizz"
| DivizableBy 5 -> "Buzz"
| n -> string n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment