Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- drop(L1, N, L2) :-
- drop(L1, N, L2, 1).
- drop([], _, [], _).
- drop([_|T], N, L2, N) :-
- drop(T, N, L2, 1).
- drop([H|T], N, L2, I) :-
- I < N,
- J is I+1,
- drop(T, N, Tmp, J),
- append([H], Tmp, L2).
- drop([H|T], N, L2, I) :-
- I > N,
- J is I+1,
- drop(T, N, Tmp, J),
- append([H], Tmp, L2).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement