Created
August 19, 2015 14:12
-
-
Save KeenS/dfaf8a2e865d048b2694 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
fizzbuzz(N, R) :- | |
fizzbuzz_(N, R); | |
fizz_(N, R); | |
buzz_(N, R); | |
N = R. | |
fizz_(N, R) :- | |
0 is N mod 3, | |
R = fizz. | |
buzz_(N, R) :- | |
0 is N mod 5, | |
R = buzz. | |
fizzbuzz_(N, R) :- | |
0 is N mod 15, | |
R = fizzbuzz. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment