Created
December 28, 2019 19:28
-
-
Save isaacabraham/d551242a8d974826b8ad3beafee57521 to your computer and use it in GitHub Desktop.
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 (|Mod|_|) div value = | |
if value % div = 0 then Some() else None | |
let fizzBuzz = function | |
| Mod 3 & Mod 5 -> "FizzBuzz" | |
| Mod 3 -> "Fizz" | |
| Mod 5 -> "Buzz" | |
| n -> string n | |
[ 1 .. 100 ] | |
|> List.map fizzBuzz | |
|> List.iter (printfn "%s") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment