I have this piece of code which suggests for a certain animal which other animals can coexist to it under those circumstances:
suggest(X) :- bigAnimal(X),bigAnimal(Y),coexist(X,Y),write(Y),nl,fail.
This loops until fail.My issue is that it prints out also the variable X
How can I exclude it from the output, thx in adcavance.
suggest(X) :-
bigAnimal(X), bigAnimal(Y), X \== Y, coexist(X,Y), write(Y), nl, fail.