mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-25 06:18:05 +02:00
5 lines
No EOL
152 B
Prolog
5 lines
No EOL
152 B
Prolog
fib(0, A, _, A).
|
|
fib(N, A, B, F) :- N1 is N - 1,
|
|
Sum is A + B,
|
|
fib(N1, B, Sum, F).
|
|
fib(N, F) :- fib(N, 0, 1, F). |