Skip to content

Instantly share code, notes, and snippets.

@cloverrose
Created August 20, 2012 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cloverrose/3405178 to your computer and use it in GitHub Desktop.
Save cloverrose/3405178 to your computer and use it in GitHub Desktop.
Seven languages "Prolog" day2
% Seven languages "Prolog" day2
fib(1, [1]).
fib(2, [1, 1]).
fib(N, [Head|[X|[Y|Tail]]]) :- fib(M, [X|[Y|Tail]]), N is M + 1, Head is X + Y.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment