Skip to content

Instantly share code, notes, and snippets.

@okaybenji
Created June 4, 2017 23:43
Show Gist options
  • Select an option

  • Save okaybenji/37bd3e225a7c56a80a77210140614887 to your computer and use it in GitHub Desktop.

Select an option

Save okaybenji/37bd3e225a7c56a80a77210140614887 to your computer and use it in GitHub Desktop.
Fibonacci generator written in Prolog
fib(0, 1).
fib(B, C) :- fib(A, B), C is A + B.
% fib(0, X) -> X = 1.
% fib(1, X) -> X = 1, X = 2.
% fib(144, X) -> X = 233.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment