Skip to content

Instantly share code, notes, and snippets.

View rezzycavalheiro's full-sized avatar

Renata Cavalheiro da Silva rezzycavalheiro

View GitHub Profile
@rezzycavalheiro
rezzycavalheiro / gist:dd69f2bb70a4e7409ecdf72986ee12dd
Created September 18, 2018 12:12 — forked from hoelzro/gist:3973656
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.