This repository has been archived on 2023-04-18. You can view files and clone it, but cannot push or open issues or pull requests.
iaj/TP1/Prolog/AidesCPP/fac.pl
2023-02-01 10:19:02 +01:00

8 lines
100 B
Prolog

fac(1,1):- !.
fac(X,F):-
X > 1,
Y is X - 1,
fac( Y, Next ),
F is X * Next.
% ?- fac(3, X).