tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
|
|
@ -0,0 +1 @@
|
|||
uniq(Data,Uniques) :- sort(Data,Uniques).
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
?- uniq([1, 2, 3, 2, 3, 4],Xs).
|
||||
Xs = [1, 2, 3, 4]
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
member1(X,[H|_]) :- X==H,!.
|
||||
member1(X,[_|T]) :- member1_(X,T).
|
||||
|
||||
distinct([],[]).
|
||||
distinct([H|T],C) :- member1(H,T),!, distinct(T,C).
|
||||
distinct([H|T],[H|C]) :- distinct(T,C).
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
?- distinct([A, A, 1, 2, 3, 2, 3, 4],Xs).
|
||||
Xs = [A, 1, 2, 3, 4]
|
||||
Loading…
Add table
Add a link
Reference in a new issue