Last active
September 26, 2020 19:31
-
-
Save gyng/11a7533715037c26e714 to your computer and use it in GitHub Desktop.
my not first fizzbuzz
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
% https://swish.swi-prolog.org/p/KDyjHEJd.pl | |
fizzbuzz(_, 0, 0, 'fizzbuzz'). | |
fizzbuzz(_, 0, _, 'fizz'). | |
fizzbuzz(_, _, 0, 'buzz'). | |
fizzbuzz(X, _, _, X). % yuno what it is | |
buzzmyfizz(N) :- | |
FIZZ is N mod 3, | |
BUZZ is N mod 5, | |
fizzbuzz(N, FIZZ, BUZZ, R), | |
write(R), nl. | |
fizzmybuzz :- | |
foreach(between(1, 100, N), buzzmyfizz(N)). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment