Skip to content

Instantly share code, notes, and snippets.

@locks
Created February 3, 2011 21:49
Show Gist options
  • Save locks/810283 to your computer and use it in GitHub Desktop.
Save locks/810283 to your computer and use it in GitHub Desktop.
fib.pl
fib(0,0).
fib(1,1).
fib(N,R) :-
N1 is N-1,
N2 is N-2,
fib(N1,R1),
fib(N2,R2),
R is R1+R2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment