Skip to content
Snippets Groups Projects
Commit 518512f0 authored by Marius Frinken's avatar Marius Frinken
Browse files

marius' stuff for the fifth tutorial session

parent 8164b530
No related branches found
No related tags found
No related merge requests found
%defines some interesting pairs of numbers
interestingPair(42, 0).
interestingPair(42, 23).
interestingPair(42, 42).
interestingPair(42, 1337).
%shows how findall works
findAllInteresting(Number, ResultList):-
findall(X,interestingPair(Number,X),ResultList).
%helper, adds 1 to Number
addOne(Number,Newnumber):-
Newnumber is 1 + Number.
%shows how maplist executes addOne on List and stores the Result
addOneToList(List,ResultList):-
maplist(addOne,List, ResultList).
%demonstrates min_list
showMinList(List,Minimum):-
min_list(List,Minimum).
\ No newline at end of file
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment