Commit 518512f0 authored by Marius Frinken's avatar Marius Frinken

marius' stuff for the fifth tutorial session

parent 8164b530
%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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment