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

enter image description here

how can exclude output, thx in adcavance.

suggest(x) :-     biganimal(x), biganimal(y), x \== y, coexist(x,y), write(y), nl, fail. 

Comments

Popular posts from this blog

ios - Change Storyboard View using Seague -

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -