Created
October 23, 2016 10:09
-
-
Save snahor/d6b402192cd7f13138def20fa1635e03 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
fun fizzbuzz' n = | |
case (n mod 5 = 0, n mod 3 = 0) of | |
(true, true) => "FizzBuzz" | |
| (true, false) => "Buzz" | |
| (false, true) => "Fizz" | |
| _ => Int.toString n | |
fun fizzbuzz n = | |
let | |
fun loop m = | |
if m > n | |
then () | |
else (print ((fizzbuzz' m) ^ "\n"); loop (m + 1)) | |
in | |
loop 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment