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

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -