Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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