Last active
July 19, 2016 10:54
-
-
Save jshurst/b6591c0140e8aad8e55e to your computer and use it in GitHub Desktop.
F# FizzBuzz Pattern Matching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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