Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %deln([1, 2, 3, 4, 5, 6, 7], R).
- %delindex([1, 1, 1, 2, 2, 2, 2, 3, 4, 5, 5, 6, 7], R).
- %start([1,2,3,4,5,6,7,8,9,10], R).
- /*
- deln([],[]).
- deln([Xh|Xt],Y):-
- 0 is Xh mod 3,
- deln(Xt,Y).
- deln([Xh|Xt],[Xh|Yt]):-
- deln(Xt, Yt).
- */
- /*
- delindex(_,[],[]).
- delindex(N,[Xh|Xt],Y):-
- 0 =:= N mod 3,
- N1 is N + 1,
- delindex(N1,Xt,Y).
- delindex(N,[Xh|Xt],[Xh|Yt]):-
- N1 is N + 1,
- delindex(N1, Xt, Yt).
- start(X, R) :- delindex(1, X, R).
- delindex(_,[],[]).*/
- %delindex([Xh|Xt],Y):-
- % delindex(Xt,Y).
- delindex([], []).
- delindex([A], [A]).
- delindex([H,A],[H,A]).
- delindex([H,A,_|T],[H,A|R]) :- delindex(T, R).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement