Created
June 7, 2016 15:06
-
-
Save aeppert/82869fab6603f76d4a54d88eca913933 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 fizzbuzz i = match ((i mod 3), (i mod 5)) with | |
| | (0,0) -> "fizzbuzz" | |
| | (_,0) -> "buzz" | |
| | (0,_) -> "fizz" | |
| | (_,_) -> string_of_int i ;; | |
| let do_fizzbuzz n = for i = 1 to n do | |
| Printf.printf "%s\n" (fizzbuzz i) | |
| done ;; | |
| do_fizzbuzz 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment