Say I have a list
[5,4,6,9]
And I want to take away from the head of the list but return the rest of the list
so: -3
[2,4,6,9]
-2
[3,4,6,9]
And then I want to move on to the next element so,
-3
[5,1,6,9],
-2
[5,2,6,9]
How could I produce a prolog predicate for this,
so far I have
change([],[]).
change([Head|Tail], [Head1|Tail]):-
process(Head, Head1).
process([],[]).
process(Head, Head1):-
Head1 is Head-3,
Head1 >=0.
process(Head, Head1):-
Head1 is Head-2,
Head1 >=0.
I'm unsure what I'd return in my recursive call, any help would be great thank you