Skip to content

Instantly share code, notes, and snippets.

@jshurst
Last active July 19, 2016 10:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jshurst/b6591c0140e8aad8e55e to your computer and use it in GitHub Desktop.
Save jshurst/b6591c0140e8aad8e55e to your computer and use it in GitHub Desktop.
F# FizzBuzz Pattern Matching
let x =
for c in [1..100] do
match c%3,c%5 with
| 0,0 -> printfn "FizzBuzz"
| 0,_ -> printfn "Fizz"
| _,0 -> printfn "Buzz"
| _ -> printfn "%d" c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment