PROLOG:How to exclude an option -
i have piece of code suggests animal other animals can coexist under circumstances:
suggest(x) :- biganimal(x),biganimal(y),coexist(x,y),write(y),nl,fail.
this loops until fail.my issue prints out variable x
how can exclude output, thx in adcavance.
suggest(x) :- biganimal(x), biganimal(y), x \== y, coexist(x,y), write(y), nl, fail.
Comments
Post a Comment