Skip to content

Instantly share code, notes, and snippets.

View rickdcneves's full-sized avatar

Ricardo Jorge da Costa Melo Neves rickdcneves

View GitHub Profile
@hoelzro
hoelzro / gist:3973656
Created October 29, 2012 13:48
Fibonacci sequence implemented in Prolog
fib(0, 1) :- !.
fib(1, 1) :- !.
fib(N, Result) :- N1 is N - 1, N2 is N - 2, fib(N1, Result1), fib(N2, Result2), Result is Result1 + Result2.