Created
May 29, 2019 17:33
-
-
Save Macorreag/66e25cad68cea4c68f43d7a4f77db5c2 to your computer and use it in GitHub Desktop.
fibonacci en prolog
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
fibo(0,1). | |
fibo(1,1). | |
fibo(N,M):-N>0,N1 is N-1,N2 is N-2,fibo(N1,M1),fibo(N2,M2),M is M1+M2. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment