Skip to content

Instantly share code, notes, and snippets.

@vgaltes
Created April 24, 2015 13:21
Show Gist options
  • Select an option

  • Save vgaltes/edafb6efc55273543a1d to your computer and use it in GitHub Desktop.

Select an option

Save vgaltes/edafb6efc55273543a1d to your computer and use it in GitHub Desktop.
FSharp FizzBuzz Kata - simpler pattern matching
let fizzBuzz input =
match (input % 3, input % 5) with
| (0, 0) -> "FizzBuzz"
| (0, _) -> "Fizz"
| (_, 0) -> "Buzz"
| (_, _) -> input.ToString()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment