Created
October 29, 2015 16:58
-
-
Save theraphim/ca813bb0056a149a8f4d 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
fib(0, A, _, A). | |
fib(N, A, B, F) :- N1 is N - 1, Sum is A + B, fib(N1, B, Sum, F), !. | |
fib(N, F) :- fib(N, 0, 1, F), !. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment