How would I go about deleting a specific amount of elements from a list? My current code doesn't even return a list. I have:
removeSpecific(_, [], [], 0):-!.
removeSpecific(Element, [Element|Tail], Tail1, NumToDelete):-
NewNumDelete is NumToDelete-1,
removeSpecific(Element, Tail, Tail1, NewNumDelete).
removeSpecific(Element, [_|Tail], [_|Tail1], NumToDelete):-
removeSpecific(Element, Tail, Tail1, NumToDelete).
When passing something like: removeSpecific(4, [2,4,5,3,4,4], NewList, 2). I get a blank list of the amount of numbers it should have (4) but not the actual amount.
Any help would be appreciated. Thanks.