Write a predicate 'everyother' which will remove every other element in a list,
starting with the second element. List length can be odd or even.
e.g. ?- everyother([g,r,o,u,l,l,o,e,r,s,p],L).
L = [g,o,l,o,r,p];
i am trying like this
remove([_,_],[]).
remove([H,H|T],R):- not(member(H,T)),remove(T,R1),delete(H,R1,A).
Pls help needed urgent
starting with the second element. List length can be odd or even.
e.g. ?- everyother([g,r,o,u,l,l,o,e,r,s,p],L).
L = [g,o,l,o,r,p];
i am trying like this
remove([_,_],[]).
remove([H,H|T],R):- not(member(H,T)),remove(T,R1),delete(H,R1,A).
Pls help needed urgent