Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,9 @@
|
|||
% Taken from RosettaCode Factorial page for Prolog
|
||||
fact(X, 1) :- X<2.
|
||||
fact(X, F) :- Y is X-1, fact(Y,Z), F is Z*X.
|
||||
|
||||
goal_expansion((X = factorial_of(N)), (X = F)) :- fact(N,F).
|
||||
|
||||
test :-
|
||||
F = factorial_of(10),
|
||||
format('!10 = ~p~n', F).
|
||||
Loading…
Add table
Add a link
Reference in a new issue