Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
teaching
AI
Commits
518512f0
Commit
518512f0
authored
Nov 28, 2018
by
Marius Frinken
Browse files
marius' stuff for the fifth tutorial session
parent
8164b530
Changes
2
Hide whitespace changes
Inline
Side-by-side
Marius/uebung05/tips.pl
0 → 100644
View file @
518512f0
%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
Marius/uebung05/uebung05.pdf
0 → 100644
View file @
518512f0
File added
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment