You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
117 B
10 lines
117 B
5 years ago
|
fib(0, 0).
|
||
|
fib(1, 1).
|
||
|
fib(N, F) :-
|
||
|
N > 1,
|
||
|
N1 is N-1,
|
||
|
N2 is N-2,
|
||
|
fib(N1, F1),
|
||
|
fib(N2, F2),
|
||
|
F is (F1+F2).
|