Skip to content

Instantly share code, notes, and snippets.

@theraphim
Created October 29, 2015 16:58
Show Gist options
  • Save theraphim/f263762e4ac66290c579 to your computer and use it in GitHub Desktop.
Save theraphim/f263762e4ac66290c579 to your computer and use it in GitHub Desktop.
fib(0, 0).
fib(1, 1).
fib(N, NF) :-
A is N - 1, B is N - 2,
fib(A, AF), fib(B, BF),
NF is AF + BF.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment