This repository has been archived on 2025-09-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
2025LogProg-project-GhentPr.../examples/meta/calculator.pl
2025-05-18 14:56:16 +02:00

15 lines
283 B
Prolog

accumulator :-
Sum = 0,
shift(Number),
NewSum is Sum + Number,
write("Result is: "), writeln(NewSum).
main :-
reset(accumulator, Number, Cont),
between(1, 5, Number),
forall()
call(Cont),
writeln("End of calculation").
:- initialization(main).