Last active
April 16, 2021 11:26
-
-
Save adacola/4860adc60472f84ef91fa5074cd2726d 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
type FizzBuzz = Fizz | Buzz | |
let fizzbuzz<'a100>() = | |
let fizz = nameof Fizz | |
let buzz = nameof Buzz | |
let fizzbuzz = nameof FizzBuzz | |
let three = (nameof int).Length | |
let five = (nameof float).Length | |
let one = (nameof System.Math.E).Length | |
let hundred = nameof<'a100>.ToCharArray() |> Array.tail |> System.String |> int | |
let zero = List.empty.Length | |
for i = one to hundred do | |
if i % five = zero && i % three = zero then stdout.WriteLine fizzbuzz | |
elif i % three = zero then stdout.WriteLine fizz | |
elif i % five = zero then stdout.WriteLine buzz | |
else i |> string |> stdout.WriteLine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment