Last active
February 1, 2021 10:45
-
-
Save pkese/d4ccd55d6d22f143cf0934e61c1a44d8 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 (|IsMultiple|_|) n x = if x % n = 0 then Some n else None | |
[1..100] | |
|> List.map (function | |
| IsMultiple 15 x -> "FizzBuzz" | |
| IsMultiple 5 x -> "Buzz" | |
| IsMultiple 3 x -> "Fizz" | |
| x -> $"{x}") | |
|> List.iter (printfn "%s") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, I love this solution; thank you so much for sharing! Unfortunately, I can't see your comment on YouTube anymore. Have you deleted it?