|
|
|
|
|
by icedog
4260 days ago
|
|
Here's the same approach in F# without the different types of String; therefore, easier to get more functional. let fizzbuzz num =
match num % 3, num % 5 with
| 0,0 -> "FizzBuzz"
| 0,_ -> "Fizz"
| _,0 -> "Buzz"
| _,_ -> num.ToString()
[1..100]
|> List.map fizzbuzz
|> List.iter (fun (s:string) -> printfn "%s" s)
|
|