Last active
April 15, 2019 18:01
-
-
Save bitmappergit/0e7e30321f447397f0b10f50f25ff42b 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 rec beer = function | |
| 0 -> print_string "No more bottles of beer on the wall, no more bottles of beer.\n" ; | |
print_string "Take one down, and pass it around, 99 bottles of beer on the wall.\n\n" | |
| 1 -> print_string "1 bottle of beer on the wall, 1 bottle of beer.\n" ; | |
print_string "Take it down, and pass it around, no more bottles of beer on the wall.\n\n" | |
| n -> Printf.printf "%d bottles of beer on the wall, %d bottles of beer.\n" n n ; | |
Printf.printf "Take one down, and pass it around, %d bottles of beer on the wall.\n\n" (n - 1); | |
beer (n - 1) | |
in beer 99 ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment